Project Snapshots

Plan or confirm a project snapshot restore

Two-step restore. A request without confirm returns restore_plan with data-loss/auth/release details and a short-lived confirm token. A request with confirm materializes the snapshot into a spare slot, captures a pre_restore undo snapshot, atomically flips the project slot, optionally restores auth identities when include:["auth"], and returns next actions. Also accepts the project's own service key (serviceKey), scoped to that project: a key for another project is refused 403 for every id, and a service key plus a SIWX header is refused 400 AUTH_CREDENTIALS_AMBIGUOUS. release and include must match between plan and confirm. A service key restores app data only: include:["auth"] is refused 403 SNAPSHOT_AUTH_RESTORE_REQUIRES_PRINCIPAL. wait:false answers 202 with a handle to poll.

post/projects/v1/{project_id}/snapshots/{snapshot_id}/restore

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/projects/v1/{project_id}/snapshots/{snapshot_id}/restore
  • Auth: one of:
    • API key in header SIGN-IN-WITH-X
    • HTTP bearer
    • HTTP bearer

Path parameters

project_idstring required

Run402 project ID. Public IDs are not UUIDs.

Example:prj_1741340000_0042
snapshot_idstring required

Request body

confirmstring

Confirm token returned in restore_plan.confirm.token. Omit to receive the restore plan.

includestring[]

Include auth identity replacement on confirmed restore. Sessions/tokens are never restored.

release'keep' | 'snapshot'

snapshot re-activates the capture-time release in the restore's flip transaction (live release pointer, static site, routes, subdomains), then re-deploys every function whose code differs to its capture-time source.

waitboolean

false on a confirmed restore answers 202 with a pollable handle instead of waiting.

Response

Restore plan or confirmed restore result.

OR

Example response

{
  "restore_plan": {
    "project_id": "prj_1741340000_0042",
    "next_actions": [
      {
        "method": "POST",
        "path": "/tiers/v1/hobby",
        "auth": "x402"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.