api.apps.snapshots:list(appId),create(appId),restore(appId, name, versionId)api.databases.snapshots:list(databaseId),create(databaseId),restore(databaseId, name, versionId)
api client from Creating the client. appId is the id of one of your apps: api.account.me() lists them.
Listing snapshots
Creating a snapshot
create() waits for the snapshot (at least 120 s before timing out). A large snapshot may not finish in time: the API then answers 202 and the SDK returns { pending: true }. The snapshot keeps generating and shows up in list() on its own, usually within 2 minutes.
Restoring a snapshot
restore(id, name, versionId) takes the name and version_id of a listed snapshot.
Downloading a snapshot
api.downloadSnapshot(url, { signal }) streams a snapshot file from its signed url (from list() or create()). It does not call the API: the API key is never sent to the storage host. It returns a ReadableStream<Uint8Array>, with nothing buffered in memory, and has no timeout (pass a signal).
SquareCloudAPIError with the storage host’s HTTP status and UNKNOWN_ERROR.
Account snapshots
api.account.snapshots({ scope }) lists every snapshot of the account, optionally only "applications" or "databases". It needs an active plan and shares the network endpoints’ rate limit (429 RATE_LIMITED).
Limits
create()is limited to one call per 180 seconds and to a daily quota that depends on the plan: going over the quota is 429DAILY_SNAPSHOTS_LIMIT_REACHED.- While a restore runs, deleting the app or starting the database is 403
RESTORE_IN_PROGRESS.
Next steps
Databases
Create and manage databases.
Snapshot API reference
The REST endpoints behind these methods.
Snapshots from the CLI
The same actions from the terminal.

