Create or replace a resource
The whole resource, as GET answers it: a frame/<id> { name, description?, transition?, code } (code: its <Frame>…</Frame> element in JSX) or { name, root } (JSON); a component { description, props, tsx }; a source its fields. Or the code alone, with Content-Type: text/jsx (a frame/<id>), text/tsx (a component) or text/typescript (the script). Built and checked as the studio checks it: a refused change changes nothing and answers every problem (422 CHECK_FAILED, errors). If-Match: the revision you read; 412 PRECONDITION_FAILED (with currentRevision) if it changed since (*: it must exist); If-None-Match: * creates only. A new resource answers 201 with its Location. Code sent as the wrong kind for its path, or a body that is neither JSON nor code (application/xml), is 415.
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.
*: create only — 412 if the resource exists already. On a GET, the ETag you hold (a weak W/"…" one too): 304 when nothing changed.
The workspace to act in. Required with an API key; otherwise the session's own.
Path Parameters
The scene's id (scn_…)
^scn_A resource path, slashes and all: frame/intro, frame/intro/title, source/data/headlines/rows, component/LowerThird, script/show.ts, a type (element/Text) or a list (frame/*)
Body
The body is of type object.
Response
The answer
What a draft operation answers. summary says what happened in a sentence; value is what a read found.
What was read: a resource (with revision and children), a type (what it takes), or a list
- Option 1 · object
- Option 2 · object
- Option 3 · object
- Option 4 · object
- Option 5 · object
- Option 6 · object
- Option 7 · object
- Option 8 · object[]
A write: where it is stored (a new id is made unique)
A write: the resource's new revision
A layer's write: the revision of the frame/<id> it is in (If-Match takes either)
A write: a unified diff of what changed
The whole draft as this answer saw it: publish takes it