Restore an application snapshot
Roll an application’s files back to a snapshot with POST /v2/apps/:app_id/snapshots/restore, using the snapshotId and versionId from the list.
POST
Restore an application snapshot
The API key for your account. You can find this in your account settings.
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
The ID of the application. You can find this in the URL of your application’s dashboard.
The snapshot
name from the listing (the application ID, optionally suffixed with _<runtime> and _<origin>), passed exactly as returned.The snapshot’s
version_id, as List Snapshots returns it.Response
Long restores
The route answers200 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
Related
- Get Restore State: progress and outcome of a restore.
- CLI:
squarecloud app snapshot restore - SDKs:
api.apps.snapshots.restore()(JavaScript),client.apps.snapshots.restore()(Python),c.Apps.Snapshots.Restore()(Go)

