Publish a draft
publish_draftMakes a draft live: commits every change the draft holds (the files sync_files sent, and its deletions) as ONE commit on the app's source and starts a build, the same as the Save button in the dashboard. No file is sent again, so what the user saw at dev_url is exactly what is committed. Pass intent as a Conventional Commits subject that describes the whole change; it is the commit message in the timeline. It works on a running draft, and on the changes kept from a draft that stopped by itself. Returns what deploy_files returns (commit_sha, job_id, deploy_url, canonical_host, is_canonical, public): the build still has to be followed with get_build_status. The draft keeps running, with nothing left unsaved. Refused when the draft holds no change, and on a project whose owner approves each deploy (use deploy_files there). Requires a read-write token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intent | No | commit subject shown in the timeline, Conventional Commits style, describing the whole change the draft holds, e.g. 'feat(home): new hero and footer' | |
| project_id | Yes | the managed project id (from list_projects) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| job_id | No | ||
| notice | No | ||
| public | 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 | |
| framework | No | ||
| approve_at | No | the kad.dev dashboard URL a human approves or rejects this plan from | |
| attempt_id | No | ||
| commit_sha | Yes | ||
| deploy_url | No | ||
| expires_at | No | ||
| project_id | Yes | ||
| managed_env | No | ||
| expires_in_s | No | the plan can no longer be approved after this many seconds | |
| is_canonical | Yes | ||
| canonical_host | No | ||
| managed_resources | No | ||
| build_log_stream_url | No |