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
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.
Path Parameters
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.