Skip to main content

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:

  1. Navigate to app.firebackup.io
  2. Sign in with Google
  3. Go to Settings > API Access
  4. Generate an API token
Token Security

API tokens provide full access to your organization. Keep them secure and never commit them to version control.

API Endpoints Overview

Authentication

EndpointMethodDescription
/auth/googleGETInitiate Google OAuth
/auth/refreshPOSTRefresh access token
/auth/meGETGet current user
/auth/logoutPOSTLogout

Projects

EndpointMethodDescription
/projectsGETList all projects
/projectsPOSTCreate project
/projects/:idGETGet project details
/projects/:idPUTUpdate project
/projects/:idDELETEDelete project
/projects/:id/collectionsGETGet collections
/projects/:id/collections/syncPOSTSync collections

Backups

EndpointMethodDescription
/backupsPOSTExecute backup
/backups/project/:projectIdGETList backups
/backups/:projectId/:backupIdGETGet backup details
/backups/restorePOSTRestore from backup
/backups/:projectId/:backupId/verifyGETVerify integrity
/backups/:projectId/:backupId/previewGETPreview contents
/backups/:projectId/diffGETCompare backups

Schedules

EndpointMethodDescription
/schedulesPOSTCreate schedule
/schedulesGETList schedules
/schedules/:idGETGet schedule
/schedules/:idPUTUpdate schedule
/schedules/:idDELETEDelete schedule
/schedules/:id/triggerPOSTManually trigger

PITR (Point-in-Time Recovery)

EndpointMethodDescription
/pitr/enablePOSTEnable PITR
/pitr/:projectId/configGETGet configuration
/pitr/:projectId/configPATCHUpdate configuration
/pitr/restorePOSTCreate restore job
/pitr/:projectId/windowsGETGet change windows

Organizations

EndpointMethodDescription
/organizationsPOSTCreate organization
/organizationsGETList organizations
/organizations/:idGETGet organization
/organizations/:idPUTUpdate organization
/organizations/:id/membersGETList members
/organizations/:id/invitesPOSTInvite 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:

PlanRequests per minute
Free60
Pro300
Enterprise1000+

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.started
  • backup.completed
  • backup.failed
  • restore.started
  • restore.completed
  • pitr.change_captured

See Webhooks for setup instructions.


Next: Authentication - Detailed authentication guide.