Backups
Every /v1 route for backups. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.
Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.
Get a restore
GET /v1/restores/{restoreId}
Key scopes: READ and DATABASES.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
restoreId | string | yes | The restore's id. |
Returns
200withV1Restore.
curl "https://api.naijacloud.com/v1/restores/$RESTORE_ID" \
-H "Authorization: Bearer $NC_API_KEY"Restore a backup over its database
POST /v1/backups/{backupId}/restore
Destructive: replaces the live data, after taking a safety backup first (its id is on the restore). Requires ADMIN.
Key scopes: WRITE and DATABASES.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
backupId | string | yes | The backup's id. |
Headers
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | no | Any unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours. |
Returns
202withV1Restore.
curl -X POST "https://api.naijacloud.com/v1/backups/$BACKUP_ID/restore" \
-H "Authorization: Bearer $NC_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"List a database's backups, newest first
GET /v1/services/{serviceId}/backups
Key scopes: READ and DATABASES.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
serviceId | string | yes | The service's id. |
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
limit | integer | no | Rows per page. Ignored when a cursor is given. |
cursor | string | no | The nextCursor of the previous page, unchanged. |
Returns
200with a page:{ data: V1Backup[], nextCursor }, where each item isV1Backup.
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/backups" \
-H "Authorization: Bearer $NC_API_KEY"Back a database up now
POST /v1/services/{serviceId}/backups
Returns the backup in PENDING; poll it until COMPLETED.
Key scopes: WRITE and DATABASES.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
serviceId | string | yes | The service's id. |
Headers
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | no | Any unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours. |
Returns
202withV1Backup.
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/backups" \
-H "Authorization: Bearer $NC_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Types
V1Backup
| Field | Type | Notes |
|---|---|---|
id | string (uuid) | |
serviceId | string (uuid) | |
status | PENDING, RUNNING, COMPLETED, FAILED | |
trigger | HOURLY, DAILY, WEEKLY, MANUAL, PRE_RESTORE | |
sizeBytes | number, or null | |
region | string, or null | Storage region, e.g. "eu". |
error | string, or null | |
errorCode | DATABASE_NOT_RUNNING, DATABASE_NOT_FOUND, NOT_PROVISIONED, NOT_SUPPORTED, DUMP_FAILED, RESTORE_FAILED, DISK_FULL, OUT_OF_MEMORY, UPLOAD_FAILED, DOWNLOAD_FAILED, BACKUP_FILE_MISSING, STORAGE_NOT_CONFIGURED, SERVER_UNREACHABLE, TIMEOUT, SERVER_NEEDS_UPDATE, ALREADY_RUNNING, NO_LONGER_EXISTS, SAFETY_BACKUP_FAILED, UNKNOWN, or null | |
createdAt | string (date-time) | |
startedAt | string (date-time), or null | |
completedAt | string (date-time), or null | |
expiresAt | string (date-time), or null | When retention deletes it. |
V1Restore
| Field | Type | Notes |
|---|---|---|
id | string (uuid) | |
serviceId | string (uuid) | |
backupId | string (uuid) | |
safetyBackupId | string (uuid), or null | The backup taken of the database just before restoring, to undo with. |
status | PENDING, RUNNING, COMPLETED, FAILED | |
error | string, or null | |
errorCode | DATABASE_NOT_RUNNING, DATABASE_NOT_FOUND, NOT_PROVISIONED, NOT_SUPPORTED, DUMP_FAILED, RESTORE_FAILED, DISK_FULL, OUT_OF_MEMORY, UPLOAD_FAILED, DOWNLOAD_FAILED, BACKUP_FILE_MISSING, STORAGE_NOT_CONFIGURED, SERVER_UNREACHABLE, TIMEOUT, SERVER_NEEDS_UPDATE, ALREADY_RUNNING, NO_LONGER_EXISTS, SAFETY_BACKUP_FAILED, UNKNOWN, or null | |
createdAt | string (date-time) | |
startedAt | string (date-time), or null | |
completedAt | string (date-time), or null |