Demote production commit
demote_commitAffects the live site. Clears a project's canonical (production) pointer by demoting the commit that holds it (by job_id) — same as the dashboard Actions → Demote. The release keeps running and stays reachable at its per-commit URL; it just stops being production, and NO replacement canonical is picked, so the project's stable host serves nothing until a commit is promoted. This is the unblock for every canonical guardrail: stop_commit, delete_commit and whole-project deletion all refuse the canonical commit, and demote_commit clears it without promoting an unrelated commit into production. No-op (reported as such) when the given commit is not the canonical. Requires a read-write token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | the deployment job id to demote (from list_deployments); must be the project's current canonical, otherwise the call is a no-op |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| status | No | present, and always "pending_approval", only when this call was parked instead of run immediately because the project's (or kad-back's own) plan-mode setting requires a human to approve it first | |
| message | Yes | ||
| plan_id | No | poll get_plan_status with this id for the eventual outcome | |
| approve_at | No | the kad.dev dashboard URL a human approves or rejects this plan from | |
| expires_in_s | No | the plan can no longer be approved after this many seconds |