Backups API

Reference for the management API's endpoints that list a database's backups and restore one into a new database.

These endpoints list a database's backups and restore one. See backups and restore for what a backup is, and the management API overview for authentication and errors.

MethodPathDoes
GET/v1/databases/{databaseId}/backupsLists a database's backups and its backup status
POST/v1/databases/{databaseId}/backups/{backupId}/restoreRestores a backup into a new database

List backups

GET /v1/databases/{databaseId}/backups

Returns the database's backup status and its backups, newest first.

curl "$MIMIC_MANAGEMENT_API/v1/databases/$DATABASE_ID/backups" \
  -H "Authorization: Bearer $MIMIC_API_KEY"
{
  "status": {
    "recoveryPoint": "2026-01-15T10:00:00.000Z",
    "recoveryPointAgeSeconds": 1800,
    "targetSeconds": 0,
    "isWithinTarget": true,
    "missedSlots": []
  },
  "backups": [
    {
      "id": "bkp_…",
      "databaseId": "db_…",
      "kind": "scheduled",
      "slot": "2026-01-15T10:00:12.000Z",
      "state": "complete",
      "recoveryPoint": "2026-01-15T10:00:12.000Z",
      "verifiedAt": "2026-01-15T10:05:00.000Z",
      "isReadBack": true,
      "isDaily": false,
      "retainUntil": "2026-01-22T00:00:09.000Z",
      "bytes": 0,
      "failure": null
    }
  ]
}

The numbers for targetSeconds and bytes are placeholders.

status

NameTypeDescription
recoveryPoint *string | nullThe newest complete backup's recovery point. Null without a complete backup.
recoveryPointAgeSeconds *number | nullHow far back a restore would go now, in seconds. Null without a backup.
targetSeconds *numberThe recovery point the service aims for, in seconds.
isWithinTarget *booleanWhether the database is inside that target now. A database that was never backed up is outside it once it is older than the target.
missedSlots *string[]The hours of the last 7 days that have no complete backup, newest first. An hour is listed once its backup had time to complete.

A backup

NameTypeDescription
id *stringThe backup's ID.
databaseId *stringThe database it is a backup of.
kind *"scheduled" | "final"scheduled for a backup the database's cluster took on its schedule (a day's full, or an hourly increment); final when taken as a deletion blocked access.
slot *stringWhen the backup was started. For a final backup, the start of the hour its deletion asked for it.
state *"running" | "complete" | "failed" | "expired"Only a complete backup can be restored.
recoveryPoint *string | nullEvery write confirmed before this time is in the backup. While the backup runs, the time it started; set to its own point once complete. Null until it starts.
verifiedAt *string | nullWhen the backup counted: when the service saw it complete, read back from where it is stored. Null until it counts.
isReadBack *booleanWhether the backup itself was read back whole from where it is stored. True for every backup that completed: each is read back before it completes. False while it runs, for one that failed before completing, and for some backups taken before the service's current storage engine, which were counted on a later backup's read-back.
isDaily *booleanWhether it is the full backup that starts a day's chain, kept for the longer retention. False for hourly increments and final backups.
retainUntil *string | nullWhen its retention ends, counted from when its chain started; it cannot be restored after. Set once complete.
bytes *number | nullIts size in bytes, as its cluster lists it. Null until complete.
failure *string | nullWhy it failed.

Complete and running backups are listed whatever their age. Failed and expired ones are listed for 7 days, so a missing hour can be seen.

Restore a backup

POST /v1/databases/{databaseId}/backups/{backupId}/restore

Restores a backup into a new database of the same organization. The database the backup was taken from is not changed.

NameTypeDescription
name *stringThe new database's name: 1 to 64 characters, trimmed. Unique in the organization.

Answers 202 with the new database, in the provisioning state. Its latestOperation has the kind restore_backup. Poll the new database's ID until it is ready.

curl -X POST "$MIMIC_MANAGEMENT_API/v1/databases/$DATABASE_ID/backups/$BACKUP_ID/restore" \
  -H "Authorization: Bearer $MIMIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "production-restored"}'

The new database is created in the region and on the cluster of the original, with the limits of the original's plan, and with no database keys or token keys. Create its credentials once it is ready.

The request creates a database, so it needs a key with the admin role for the whole organization.

StatusWhen
403The key has the member role, or is scoped to one database
404The backup does not exist, or is not a backup of this database
409The backup is not complete or its retention has ended; it was taken before the service's current storage engine; the place that held the backup is no longer available, and the backup with it; the name is taken; the plan's maximum number of databases is reached; or the original database's grace period is over

A failed restore is not retried with POST …/retry. Delete the new database and restore the backup again.