Publish the draft
Publishes the draft exactly as it was at draftRevision (required: in the body, or as If-Match: "<draftRevision>"; sent both ways, they must name the same draft, else 422 INVALID_INPUT; every draft answer and GET /scenes/ carry the current one), whatever was edited since. It is checked as the channel loads it — the document check, and the type check of script/show.ts, script/state.ts, every frame/<id> and component — and becomes the next version.
- When the draft changed after that revision but nobody published since, the answer says so:
stale: trueand a note (those edits are not in this version; they are still in the draft). - When a version was published after the one that revision’s draft was based on, publishing it would take that version back: 409 STALE_PUBLISH (412 when the draftRevision came as If-Match) names
publishedVersion,basedOnand what would bereverted. Read the draft again, or sendoverwritePublished: <publishedVersion>to replace it anyway. When that version is a revert (publishedVersionIsRevert: true), reading again changes nothing: sendoverwritePublishedto publish the draft over it, or discard the draft to keep the reverted version. Two publishes at once are answered in turn: the second isunchangedat the first one’s version when it publishes the same draft, else that STALE_PUBLISH. - A stream that has the scene on air plays the new version at once: 409 CONFIRM_REQUIRED names the streams; send
confirm: trueto accept that. - A draftRevision no answer about this scene gave is 422 INVALID_INPUT in the body, 412 PRECONDITION_FAILED as If-Match; one with edits the server doesn’t have yet is 409 DRAFT_NOT_SAVED.
A draft equal to what is published makes no version (unchanged: true). dryRun: true checks it and lists what would change, publishing nothing. Refused with every problem (422 SCENE_INVALID, errors, each with its path and line for a type error). The answer lists the changes as resource paths and notes worth knowing.
Authorizations
A Streamloop API key (sl_…). It carries no workspace: send X-Workspace-Id too (400 WORKSPACE_REQUIRED otherwise).
Headers
The revision (ETag) you read — one, or a comma-separated list of which any current one matches — compared strongly (a weak W/"…" tag never matches): refused with 412 PRECONDITION_FAILED if the resource changed since or no longer exists (the problem carries currentRevision, null when it is gone, and for a layer frameRevision: either is taken). A layer takes its own revision or that of the frame/<id> it is in. *: it must exist. Checked atomically with the write: of two writes sent at once with the same revision, one lands and the other is 412.
Retry safely: the key (per caller, workspace, method and path) is taken before the request runs, and its first answer is replayed for 24 hours, with Idempotency-Replayed: true — a repeat sent while the first still runs waits for it. The same key with a different body is 422 IDEMPOTENCY_KEY_REUSED. A 5xx is not kept: the retry runs.
200The workspace to act in. Required with an API key; otherwise the session's own.
Path Parameters
The scene's id (scn_…)
^scn_Body
The draft to publish, from the answer you reviewed (or send If-Match)
I accept what CONFIRM_REQUIRED named: viewers see this at once
I accept what STALE_PUBLISH named: replace this published version (its number) and what was published since the draft's base
x >= 1Only check, and say what would change
Response
Published (or checked, with dryRun)
The published version after this call. On a dry run it is unchanged (0: never published) and the draft would become the next one
What happened and what comes next, in a sentence
null on a dry run of a scene never published
The draft was what is published already: no new version
What changed since the previous version, as resource paths (change frame/main/title props.value, add source/data/hn)
Only checked: nothing was published
What to know about this publish: edits a pinned draftRevision left in the draft, a revert's draft
The draftRevision was an older one: the draft has changed since, and those changes are not published