Operations
What an operation is, the kinds and states it has, how to follow one and how to retry one that failed.
Work on a database that takes time runs as an operation. When you create, suspend, resume, delete or restore a database, or rotate one of its keys, the request is recorded as an operation and answered at once; the work then runs in the background. An operation is how you find out how far it got.
Where to see them
- A database's Operations page lists its operations, newest first, with their state, step and times.
- The Overview shows the most recent ones, and a banner while one is running or after one failed.
- The management API returns the newest operation as the database's
latestOperation, and the 50 most recent fromGET /v1/databases/{databaseId}/operations.
Kinds
| Kind | Started by |
|---|---|
create_database | Creating a database, or retrying a failed creation |
suspend_database | Suspending |
resume_database | Resuming |
delete_database | Deleting |
restore_database | Restoring a deleted database during its grace period |
restore_backup | Restoring a backup into a new database |
rotate_database_key | Rotating a database key |
States
| State | Meaning |
|---|---|
pending | Recorded, not started yet |
running | In progress |
succeeded | Finished |
failed | Stopped with an error, given in error |
cancelled | Stopped on purpose: a deletion cancelled by a restore |
Steps
While an operation runs, its step names what it is doing, for example placing, creating, configuring and verifying for a creation. Steps are for people to read: show them, but do not write code that depends on their exact text.
Two steps of a deletion last a long time by design:
waiting for the grace period: access is blocked and the database can be restored.held in backups: the database is removed and only its backups remain, until their retention ends.
A key rotation waits in waiting for the overlap window until the old key is due to be revoked.
One at a time
A database runs one operation at a time. A request that needs an operation while another is pending or running is refused with a conflict: wait for the current one to finish. There are two exceptions:
- Restoring a deleted database cancels the deletion that is waiting out its grace period.
- A key rotation that is waiting out its overlap window does not hold up other operations.
Retrying
Every step of an operation is safe to repeat, so an operation that failed can be run again and continues where it stopped. In the dashboard the failure banner has a Retry button; in the management API it is POST /v1/databases/{databaseId}/retry.
Retry acts on the database's latest operation, and only if that operation failed:
| Failed operation | What retry does |
|---|---|
create_database | Runs the creation again |
delete_database | Resumes the deletion |
restore_database | Runs the restore again |
suspend_database, resume_database | Runs it again |
rotate_database_key | Resumes revoking the old key |
restore_backup | Refused. Delete the new database and restore the backup again |
Retrying when the latest operation did not fail is refused with a conflict.
Following an operation from a script
Poll the database until its state is the one you are waiting for, and stop if the latest operation failed:
curl "$MIMIC_MANAGEMENT_API/v1/databases/$DATABASE_ID" \
-H "Authorization: Bearer $MIMIC_API_KEY"{
"id": "db_…",
"state": "provisioning",
"latestOperation": {
"id": "op_…",
"databaseId": "db_…",
"kind": "create_database",
"state": "running",
"step": "creating",
"error": null,
"createdAt": "2026-01-15T10:00:00.000Z",
"updatedAt": "2026-01-15T10:00:02.000Z",
"completedAt": null
}
}The response above is shortened; see databases in the API for every field.