Skip to main content
POST
Restore an application snapshot
This route has a rate limit of 1 request every 60 seconds. The account that owns the application also has a daily restore cap: as many restores per 24 hours as its plan’s daily snapshot allowance, shared between applications and databases and counted separately from the snapshots it takes.
string
required
The API key for your account. You can find this in your account settings.
Requires an API key with the snapshots:write scope. Restore Snapshot rolls an application’s storage back to a previous snapshot, replacing its current files with the ones captured at snapshot time. Use it to recover from a bad deploy or accidental deletion. Get the snapshotId and versionId values from List Snapshots, they are not something you construct by hand. snapshotId is the snapshot name exactly as List Snapshots returns it (the application ID, optionally suffixed with _<runtime> and _<origin>), and versionId is its version_id; malformed values are rejected before the restore starts. The restore stops the application, replaces its files with the snapshot’s and starts it again, so no separate restart is needed. While it runs, start, stop, restart and delete answer 409 RESTORE_IN_PROGRESS. Snapshots (and therefore restores) are only available with an active plan. On workspace-shared applications the caller needs the admin role. The restore is refused before any file is touched while Square Shield suspends the application (409 CONTAINER_TEMPORARILY_SUSPENDED). The suspension is temporary: try again later. Check the email of the account for the reason.

Parameters

string
required
The ID of the application. You can find this in the URL of your application’s dashboard.
string
required
The snapshot name from the listing (the application ID, optionally suffixed with _<runtime> and _<origin>), passed exactly as returned.
string
required
The snapshot’s version_id, as List Snapshots returns it.

Response

string
Indicates whether the call was successful: success if it was, error if not.

Long restores

The route answers 200 when the restore finishes within about 90 seconds. A larger one answers 202 with the code SNAPSHOT_RESTORE_PROCESSING. It keeps the error envelope for compatibility, but it is not a failure: the restore is still running in the background. Don’t send the restore again. Follow it with Get Restore State, which reports the step it is on and, at the end, success or error with the failure code.

Common errors