Reference
View as MarkdownBackups API
21 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes
/backup-destinationsList backup destinations
Response 200 · OK · application/json
- DestinationView[] | nullrequired
401Unauthorized403Forbidden500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-destinationsAdd a backup destination
An S3-compatible bucket or a directory on the database's host (local; not off-site). Credentials are write-only. Requires the admin scope. Recommended S3 permissions: s3:PutObject, s3:GetObject, s3:DeleteObject, s3:ListBucket, s3:AbortMultipartUpload on a bucket-scoped key.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
Request body · application/json · required
- accessKeystringWrite-only.
- bucketstring
- compatModebooleanLimit SDK checksums for non-AWS stores. Default: on when an endpoint is set.
- endpointstringS3-compatible endpoint URL; empty means AWS S3.
- kindenum: s3 | localrequired
- localDirstringLocal destinations: relative sub-directory of the agent's backup directory.
- namestringrequired
- pathStylebooleanUse path-style addressing (MinIO, SeaweedFS, Garage, most self-hosted stores).
- prefixstringKey prefix inside the bucket or directory.
- regionstring
- secretKeystringWrite-only.
Response 201 · Created · application/json
- accessKeySetbooleanrequired
- bucketstring
- compatModebooleanrequired
- createdAtstring (date-time)required
- endpointstring
- idstringrequired
- inUseBySchedulesinteger (int64)required
- kindenum: s3 | localrequired
- lastTestAtstring (date-time)
- lastTestMessagestring
- lastTestOkboolean
- localDirstring
- namestringrequired
- offSitebooleanrequiredFalse for local directories: a backup on the database's own host does not survive the loss of that host.
- pathStylebooleanrequired
- prefixstring
- regionstring
- secretKeySetbooleanrequired
- storedBackupsinteger (int64)required
401Unauthorized403Forbidden409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-destinations/{destinationId}Update a backup destination
| Parameter | In | Type | Description |
|---|---|---|---|
destinationIdrequired | path | string |
Request body · application/json · required
- accessKeystringOmit or leave empty to keep the stored key.
- bucketstring
- compatModeboolean
- endpointstring
- localDirstring
- namestring
- pathStyleboolean
- prefixstring
- regionstring
- secretKeystringOmit or leave empty to keep the stored key.
Response 200 · OK · application/json
- accessKeySetbooleanrequired
- bucketstring
- compatModebooleanrequired
- createdAtstring (date-time)required
- endpointstring
- idstringrequired
- inUseBySchedulesinteger (int64)required
- kindenum: s3 | localrequired
- lastTestAtstring (date-time)
- lastTestMessagestring
- lastTestOkboolean
- localDirstring
- namestringrequired
- offSitebooleanrequiredFalse for local directories: a backup on the database's own host does not survive the loss of that host.
- pathStylebooleanrequired
- prefixstring
- regionstring
- secretKeySetbooleanrequired
- storedBackupsinteger (int64)required
401Unauthorized403Forbidden409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-destinations/{destinationId}Delete a backup destination
409 destination_in_use while a schedule or a stored backup uses it.
| Parameter | In | Type | Description |
|---|---|---|---|
destinationIdrequired | path | string |
Response 204 · No Content
No body.
401Unauthorized403Forbidden409Conflictdestination_in_use422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-destinations/{destinationId}/testTest a backup destination
The agent on the chosen server writes, reads back and deletes a probe object. Waits up to 25 seconds; if the agent has not answered by then the response carries no test result yet (poll the destination).
| Parameter | In | Type | Description |
|---|---|---|---|
destinationIdrequired | path | string |
Request body · application/json · required
- serverIdstringrequiredThe server whose agent performs the test (it is the one that talks to the destination).
Response 200 · OK · application/json
- accessKeySetbooleanrequired
- bucketstring
- compatModebooleanrequired
- createdAtstring (date-time)required
- endpointstring
- idstringrequired
- inUseBySchedulesinteger (int64)required
- kindenum: s3 | localrequired
- lastTestAtstring (date-time)
- lastTestMessagestring
- lastTestOkboolean
- localDirstring
- namestringrequired
- offSitebooleanrequiredFalse for local directories: a backup on the database's own host does not survive the loss of that host.
- pathStylebooleanrequired
- prefixstring
- regionstring
- secretKeySetbooleanrequired
- storedBackupsinteger (int64)required
401Unauthorized403Forbidden409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-restores/{restoreId}Get a restore
| Parameter | In | Type | Description |
|---|---|---|---|
restoreIdrequired | path | string |
Response 200 · OK · application/json
- actorstring
- backupIdstringrequired
- createdAtstring (date-time)required
- errorstring
- finishedAtstring (date-time)
- idstringrequired
- modeenum: new | in_placerequired
- preBackupIdstring
- sourceServiceIdstringrequired
- statusenum: provisioning | pre_backup | restoring | succeeded | failedrequired
- targetServiceIdstring
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-schedules/{scheduleId}Update a backup schedule
| Parameter | In | Type | Description |
|---|---|---|---|
scheduleIdrequired | path | string |
Request body · application/json · required
- cronstring
- destinationIdstring
- enabledboolean
- retentionCountinteger (int64)
- retentionDaysinteger (int64)
- timezonestring
Response 200 · OK · application/json
- createdAtstring (date-time)required
- cronstringrequired
- destinationIdstringrequired
- destinationNamestring
- enabledbooleanrequired
- idstringrequired
- lastRunAtstring (date-time)
- nextRunAtstring (date-time)
- retentionCountinteger (int64)required
- retentionDaysinteger (int64)required
- serviceIdstringrequired
- timezonestringrequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backup-schedules/{scheduleId}Delete a backup schedule
| Parameter | In | Type | Description |
|---|---|---|---|
scheduleIdrequired | path | string |
Response 204 · No Content
No body.
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backups/{backupId}Get a backup
| Parameter | In | Type | Description |
|---|---|---|---|
backupIdrequired | path | string |
Response 200 · OK · application/json
- actorstring
- createdAtstring (date-time)required
- databasestring
- destinationIdstringrequired
- destinationKindstring
- destinationNamestring
- enginestringrequired
- engineVersionstring
- errorstring
- finishedAtstring (date-time)
- formatstring
- idstringrequired
- lockedbooleanrequired
- objectDeletedbooleanrequiredTrue once retention or a user removed the stored object; the row stays as history.
- objectKeystring
- restorablebooleanrequired
- scheduleIdstring
- serverIdstring
- serviceIdstringrequired
- sha256string
- sizeBytesinteger (int64)required
- startedAtstring (date-time)
- statusenum: queued | running | succeeded | failed | skipped | expiredrequired
- triggerenum: manual | schedule | pre_restorerequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backups/{backupId}Delete a backup
Deletes the stored object through the agent. 409 when the backup is locked or its server is offline.
| Parameter | In | Type | Description |
|---|---|---|---|
backupIdrequired | path | string |
Response 204 · No Content
No body.
401Unauthorized403Forbidden409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backups/{backupId}/lockLock or unlock a backup
Locked backups are never removed by retention or deleted.
| Parameter | In | Type | Description |
|---|---|---|---|
backupIdrequired | path | string |
Request body · application/json · required
- lockedbooleanrequired
Response 200 · OK · application/json
- actorstring
- createdAtstring (date-time)required
- databasestring
- destinationIdstringrequired
- destinationKindstring
- destinationNamestring
- enginestringrequired
- engineVersionstring
- errorstring
- finishedAtstring (date-time)
- formatstring
- idstringrequired
- lockedbooleanrequired
- objectDeletedbooleanrequiredTrue once retention or a user removed the stored object; the row stays as history.
- objectKeystring
- restorablebooleanrequired
- scheduleIdstring
- serverIdstring
- serviceIdstringrequired
- sha256string
- sizeBytesinteger (int64)required
- startedAtstring (date-time)
- statusenum: queued | running | succeeded | failed | skipped | expiredrequired
- triggerenum: manual | schedule | pre_restorerequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/backups/{backupId}/restoreRestore a backup
mode new (default) creates a sibling database, deploys it empty and restores into it; the original is untouched. mode in_place first takes a safety backup, then overwrites the database; it needs confirmSlug. Poll the restore.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
backupIdrequired | path | string |
Request body · application/json · required
- confirmSlugstringIn-place restores: the database's slug.
- modeenum: new | in_placenew: restore into a new sibling database (default, the original is untouched). in_place: overwrite this database after a safety backup.
- namestringName of the new database (mode new).
- serverIdstringServer for the new database (mode new). A backup stored in a local directory can only be restored on its own server.
Response 202 · Accepted · application/json
- actorstring
- backupIdstringrequired
- createdAtstring (date-time)required
- errorstring
- finishedAtstring (date-time)
- idstringrequired
- modeenum: new | in_placerequired
- preBackupIdstring
- sourceServiceIdstringrequired
- statusenum: provisioning | pre_backup | restoring | succeeded | failedrequired
- targetServiceIdstring
401Unauthorized403Forbidden409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/dump-restores/{restoreId}Get a restore from a dump file
| Parameter | In | Type | Description |
|---|---|---|---|
restoreIdrequired | path | string |
Response 200 · OK · application/json
- actorstring
- bytesReceivedinteger (int64)requiredBytes the agent has accepted so far.
- createdAtstring (date-time)required
- errorstring
- fileNamestring
- finishedAtstring (date-time)
- formatstringDetected from the file's first bytes: pg_custom, pg_tar, sql or mongo_archive.
- gzipboolean
- idstringrequired
- logstringProgress of the restore (the newest 64 KiB), one line per entry. Omitted from lists.
- maxUploadBytesinteger (int64)requiredThe largest file the control plane accepts.
- modeenum: new | in_placerequired
- preBackupIdstring
- sha256stringChecksum of the uploaded bytes, known once the upload completed.
- sizeBytesinteger (int64)requiredBytes announced by the upload.
- sourceServiceIdstringrequired
- startedAtstring (date-time)
- statusenum: provisioning | pre_backup | awaiting_upload | uploading | restoring | succeeded | failedrequired
- targetServiceIdstring
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/dump-restores/{restoreId}/cancelCancel a restore that has not received its file
Only while the restore is provisioning, taking its safety backup or awaiting its file. The new database it created stays; delete it like any service.
| Parameter | In | Type | Description |
|---|---|---|---|
restoreIdrequired | path | string |
Response 200 · OK · application/json
- actorstring
- bytesReceivedinteger (int64)requiredBytes the agent has accepted so far.
- createdAtstring (date-time)required
- errorstring
- fileNamestring
- finishedAtstring (date-time)
- formatstringDetected from the file's first bytes: pg_custom, pg_tar, sql or mongo_archive.
- gzipboolean
- idstringrequired
- logstringProgress of the restore (the newest 64 KiB), one line per entry. Omitted from lists.
- maxUploadBytesinteger (int64)requiredThe largest file the control plane accepts.
- modeenum: new | in_placerequired
- preBackupIdstring
- sha256stringChecksum of the uploaded bytes, known once the upload completed.
- sizeBytesinteger (int64)requiredBytes announced by the upload.
- sourceServiceIdstringrequired
- startedAtstring (date-time)
- statusenum: provisioning | pre_backup | awaiting_upload | uploading | restoring | succeeded | failedrequired
- targetServiceIdstring
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/backup-restoresList restores of a database
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- RestoreView[] | nullrequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/backup-schedulesList a database's backup schedules
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- ScheduleView[] | nullrequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/backup-schedulesSchedule recurring backups
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
serviceIdrequired | path | string |
Request body · application/json · required
- cronstringrequired5-field cron expression or @hourly/@daily/@weekly/@monthly/@yearly. At most one run every 5 minutes.
- destinationIdstringrequired
- enabledboolean
- retentionCountinteger (int64)Keep the newest N successful backups (default 7, 0 = no limit).
- retentionDaysinteger (int64)Delete backups older than N days (0 = no limit).
- timezonestringIANA zone, default UTC.
Response 201 · Created · application/json
- createdAtstring (date-time)required
- cronstringrequired
- destinationIdstringrequired
- destinationNamestring
- enabledbooleanrequired
- idstringrequired
- lastRunAtstring (date-time)
- nextRunAtstring (date-time)
- retentionCountinteger (int64)required
- retentionDaysinteger (int64)required
- serviceIdstringrequired
- timezonestringrequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/backupsList a database's backups
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string | |
limit | query | integer (int64) |
Response 200 · OK · application/json
- BackupView[] | nullrequired
401Unauthorized403Forbidden422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/backupsBack up a database now
Returns 202 with a queued backup; poll it or listen for backup.updated events. 409 server_offline / database_not_running when it can not start.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
serviceIdrequired | path | string |
Request body · application/json · required
- destinationIdstringrequired
Response 202 · Accepted · application/json
- actorstring
- createdAtstring (date-time)required
- databasestring
- destinationIdstringrequired
- destinationKindstring
- destinationNamestring
- enginestringrequired
- engineVersionstring
- errorstring
- finishedAtstring (date-time)
- formatstring
- idstringrequired
- lockedbooleanrequired
- objectDeletedbooleanrequiredTrue once retention or a user removed the stored object; the row stays as history.
- objectKeystring
- restorablebooleanrequired
- scheduleIdstring
- serverIdstring
- serviceIdstringrequired
- sha256string
- sizeBytesinteger (int64)required
- startedAtstring (date-time)
- statusenum: queued | running | succeeded | failed | skipped | expiredrequired
- triggerenum: manual | schedule | pre_restorerequired
401Unauthorized403Forbidden409Conflictserver_offline422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/dump-restoresList restores from a dump file of a database
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- DumpRestoreView[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/dump-restoresRestore a database from a dump file
Prepares a restore of a managed database from a file you upload: a pg_dump file (custom -Fc, tar -Ft or plain SQL, optionally gzipped), a mysqldump/mariadb-dump SQL file (optionally gzipped) or a mongodump --archive file. mode new (default) creates a sibling database and deploys it empty; mode in_place first takes a safety backup (needs confirmSlug) and then replaces this database's data. Poll the restore until its status is awaiting_upload, then send the file: PUT /api/v1/dump-restores/{restoreId}/upload with the file as the raw request body (Content-Type: application/octet-stream, Content-Length required, optional ?fileName=). It answers 202 once the agent has the whole file (status restoring); poll GET /dump-restores/{restoreId} for succeeded or failed. The control plane stores nothing: the bytes stream through it to the agent. The format is detected from the file's first bytes (422 unsupported_dump_format when it does not fit the engine); 413 file_too_large above the limit (maxUploadBytes, default 5 GiB).
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
serviceIdrequired | path | string |
Request body · application/json · required
- confirmSlugstringIn-place restores: the database's slug.
- destinationIdstringIn-place restores: the backup destination of the safety backup; default the destination of the database's backup schedule.
- fileNamestringThe name of the file about to be uploaded (shown in the history).
- modeenum: new | in_placenew: restore into a new sibling database (default, the original is untouched). in_place: replace this database's data after a safety backup.
- namestringName of the new database (mode new).
- serverIdstringServer for the new database (mode new); default the source's server.
- sizeBytesinteger (int64)The size of the file about to be uploaded. A file above the limit is refused before anything is created.
Response 202 · Accepted · application/json
- actorstring
- bytesReceivedinteger (int64)requiredBytes the agent has accepted so far.
- createdAtstring (date-time)required
- errorstring
- fileNamestring
- finishedAtstring (date-time)
- formatstringDetected from the file's first bytes: pg_custom, pg_tar, sql or mongo_archive.
- gzipboolean
- idstringrequired
- logstringProgress of the restore (the newest 64 KiB), one line per entry. Omitted from lists.
- maxUploadBytesinteger (int64)requiredThe largest file the control plane accepts.
- modeenum: new | in_placerequired
- preBackupIdstring
- sha256stringChecksum of the uploaded bytes, known once the upload completed.
- sizeBytesinteger (int64)requiredBytes announced by the upload.
- sourceServiceIdstringrequired
- startedAtstring (date-time)
- statusenum: provisioning | pre_backup | awaiting_upload | uploading | restoring | succeeded | failedrequired
- targetServiceIdstring
401Unauthorized403Forbidden404Not Found409Conflict413Request Entity Too Largefile_too_large422Unprocessable Entityunsupported_dump_format500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.