Apply

Commit a v2 deploy plan

Drive the deploy state machine: validate → stage → migrate-gate → migrate → schema-settle → activate → ready. Optional required_plan repeats reviewed-plan verification before content mutation, migration execution, function update, activation, or release pointer changes. Returns the operation snapshot promptly, including subdomain_bindings freshness for managed hosts; the SDK polls /operations/:operation_id if non-terminal. Idempotent per plan, even mid-run: only the commit that claims the operation drives it; a commit of the same plan while it runs answers status: "running" with a poll action and re-runs nothing, a finished one replays its stored result, a paused one resumes. Safe to re-send after a lost response (502/503/504, dropped connection). Idempotency-Key middleware applied.

post/apply/v1/plans/{plan_id}/commit

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/apply/v1/plans/{plan_id}/commit
  • Auth: API key in header SIGN-IN-WITH-X

Path parameters

plan_idstring required

Plan ID

Headers

SIGN-IN-WITH-Xstring required

SIWX auth header — base64-encoded JSON payload containing a signed CAIP-122 (EIP-4361) message. See https://docs.x402.org/extensions/sign-in-with-x.

Request body

Response

Operation snapshot. Status: ready | running | schema_settling | activation_pending | needs_repair.

operation_idstring required
release_idstring nullable required
status'planning' | 'uploading' | 'committing' | 'staging' | 'gating' | 'migrating' | 'schema_settling' | 'activating' | 'activation_pending' | 'needs_repair' | 'ready' | 'failed' | 'rolled_back' required
urlsobject

site is the project's public URL, present when the project owns at least one subdomain. console is the project's page in the console (https://console.run402.com/orgs/{org_id}/projects/{project_id}), present exactly when site is present; a function-only project with no site carries no console key either.

snapshot_skipped_reasonstring nullable

Present when pre-migration snapshotting was intentionally skipped or downgraded, for example because the project exceeded the snapshot size threshold.

Example response

{
  "next_actions": [
    {
      "method": "POST",
      "path": "/tiers/v1/hobby",
      "auth": "x402"
    }
  ],
  "restore_point": {
    "restore_url": "/projects/v1/prj_.../snapshots/snap_.../restore",
    "command": "run402 snapshots restore prj_... snap_..."
  }
}

Changes

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