API Reference
The FireBackup API provides programmatic access to all platform features. Use it to integrate backups into your CI/CD pipeline, build custom dashboards, or automate your data protection workflow.
Base URL
https://api.firebackup.io/api/v1
Authentication
All API requests require authentication using a Bearer token and Organization ID.
Headers
Authorization: Bearer <your-access-token>
X-Organization-Id: <your-organization-id>
Content-Type: application/json
Obtaining Tokens
Tokens are obtained through Google OAuth:
- Navigate to app.firebackup.io
- Sign in with Google
- Go to Settings > API Access
- Generate an API token
API tokens provide full access to your organization. Keep them secure and never commit them to version control.
API Endpoints Overview
Authentication
| Endpoint | Method | Description |
|---|---|---|
/auth/google | GET | Initiate Google OAuth |
/auth/refresh | POST | Refresh access token |
/auth/me | GET | Get current user |
/auth/logout | POST | Logout |
Projects
| Endpoint | Method | Description |
|---|---|---|
/projects | GET | List all projects |
/projects | POST | Create project |
/projects/:id | GET | Get project details |
/projects/:id | PUT | Update project |
/projects/:id | DELETE | Delete project |
/projects/:id/collections | GET | Get collections |
/projects/:id/collections/sync | POST | Sync collections |
Backups
| Endpoint | Method | Description |
|---|---|---|
/backups | POST | Execute backup |
/backups/project/:projectId | GET | List backups |
/backups/:projectId/:backupId | GET | Get backup details |
/backups/restore | POST | Restore from backup |
/backups/:projectId/:backupId/verify | GET | Verify integrity |
/backups/:projectId/:backupId/preview | GET | Preview contents |
/backups/:projectId/diff | GET | Compare backups |
Schedules
| Endpoint | Method | Description |
|---|---|---|
/schedules | POST | Create schedule |
/schedules | GET | List schedules |
/schedules/:id | GET | Get schedule |
/schedules/:id | PUT | Update schedule |
/schedules/:id | DELETE | Delete schedule |
/schedules/:id/trigger | POST | Manually trigger |
PITR (Point-in-Time Recovery)
| Endpoint | Method | Description |
|---|---|---|
/pitr/enable | POST | Enable PITR |
/pitr/:projectId/config | GET | Get configuration |
/pitr/:projectId/config | PATCH | Update configuration |
/pitr/restore | POST | Create restore job |
/pitr/:projectId/windows | GET | Get change windows |
Organizations
| Endpoint | Method | Description |
|---|---|---|
/organizations | POST | Create organization |
/organizations | GET | List organizations |
/organizations/:id | GET | Get organization |
/organizations/:id | PUT | Update organization |
/organizations/:id/members | GET | List members |
/organizations/:id/invites | POST | Invite member |
Quick Examples
List Projects
curl -X GET https://api.firebackup.io/api/v1/projects \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Organization-Id: YOUR_ORG_ID"
Response:
{
"success": true,
"data": [
{
"id": "proj_abc123",
"name": "Production App",
"firebaseProjectId": "my-firebase-prod",
"status": "connected",
"collectionsCount": 12
}
]
}
Create Backup
curl -X POST https://api.firebackup.io/api/v1/backups \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Organization-Id: YOUR_ORG_ID" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_abc123",
"type": "full",
"collections": ["users", "orders"],
"compress": true,
"encrypt": true
}'
Response:
{
"success": true,
"data": {
"backupId": "bkp_xyz789",
"status": "in_progress",
"startedAt": "2025-01-15T10:00:00Z"
}
}
Get Backup Status
curl -X GET https://api.firebackup.io/api/v1/backups/proj_abc123/bkp_xyz789 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Organization-Id: YOUR_ORG_ID"
Response:
{
"success": true,
"data": {
"id": "bkp_xyz789",
"status": "completed",
"duration": 45,
"documentsCount": 12450,
"originalSize": 15200000,
"compressedSize": 2100000,
"checksum": "sha256:a1b2c3d4..."
}
}
Response Format
All API responses follow this structure:
Success Response
{
"success": true,
"data": { ... },
"meta": {
"page": 1,
"limit": 20,
"total": 100
}
}
Error Response
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid project ID",
"details": [
{ "field": "projectId", "message": "Must be a valid UUID" }
]
}
}
Rate Limiting
API requests are rate-limited to ensure fair usage:
| Plan | Requests per minute |
|---|---|
| Free | 60 |
| Pro | 300 |
| Enterprise | 1000+ |
Rate limit headers are included in responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 55
X-RateLimit-Reset: 1705330800
SDKs
We provide official SDKs for common languages:
- TypeScript/JavaScript:
@firebackup/sdk - Python:
firebackup-python - Go:
github.com/firebackup/go-sdk
See SDKs & Packages for installation and usage.
Webhook Events
Subscribe to events for real-time notifications:
backup.startedbackup.completedbackup.failedrestore.startedrestore.completedpitr.change_captured
See Webhooks for setup instructions.
Next: Authentication - Detailed authentication guide.