Get the state of a database snapshot restore
Follow a database restore with GET /v2/databases/:database_id/snapshots/restore: whether it is queued, running, finished or failed, the step it is on and the error code.
GET
Get the state of a database snapshot restore
The API key for your account. You can find this in your account settings.
snapshots:read scope.
Returns the progress and the outcome of the database’s last snapshot restore. A database restore loads the whole snapshot into a new database before it replaces the current one, so on a large database it usually outlives the restore route’s response and answers 202 SNAPSHOT_RESTORE_PROCESSING. Poll this route until state is success or error.
The outcome stays available for one hour after the restore ends. After that, or when the database was never restored, state is none.
Parameters
Response
Steps
Every restore starts atqueued, then inspect, and ends at done. In between, a database goes through these steps, in this order:
A snapshot of MySQL or MongoDB in the older format adds the step
recovery. A restore that was cut short ends at the step interrupted, with the code RESTORE_INTERRUPTED. Treat a step you don’t know as “still running”: new ones can be added.
Failure codes
The codesstate: "error" carries are the same ones the restore route answers with when it fails within its response time:
Polling example
Common errors
Related
- Restore Snapshot: starts the restore this route follows.
- List Snapshots: the snapshots that can be restored.
- Snapshots and restore: what a database snapshot holds and how a restore behaves.

