<timeline> element whose children are the
nodes. Rendermate renders it to frames, previews, links and MP4 or M4A exports. Documents are versioned:
each edit is a commit that makes a new version, and every version stays readable.
What does a document look like?
A document isexport default (<timeline …>…</timeline>);. This one is 2 seconds of 1080p: a red
background with a white dot in the middle.
How is JSX written in a document?
- Elements are nodes. The tag is the node’s type, the attributes its fields, and the children
its children. Every node has an
idthat is unique in the document. - Times are seconds, such as
start: 1.5.Doc.ticks(n)is a time that no number of seconds would round to. - Colours are
"#rrggbb"or"#rrggbbaa", orDoc.rgb(r, g, b)andDoc.rgba(r, g, b, a)of fractions from 0 to 1. - Keyframes are
Doc.keys([seconds, value, easing, id], …). - Shared animated values are
const name = value;beforeexport default, read by their name. - Arithmetic on numbers is worked out as it’s read:
width={(1920 - 2 * 80) / 3}. - Visibility conditions:
{a > b && <shape … />}draws the node while the condition holds. - Cut values: a document as the API returns it shortens long strings to
Doc.cut("start", length)and long arrays with...Doc.more(n). Leave them where they are when you edit, and the stored value stays.
Top level
The
<timeline> element’s children are its nodes.
Canvas and time
canvas sets the output’s width and height in pixels, its frameRate as a fraction
({numerator: 30, denominator: 1}) and its duration in seconds. Times are stored as whole ticks,
and ticksPerSecond sets how many make a second; it can’t change after a document is created.
Nodes
Each node has anid that is unique in the document, and common: its start, its duration and
its order among its siblings. A node shows from start for duration seconds. Node types
include:
media,audio: video and audio from an asset, trimmed and retimed.text: paragraphs of styled text.shape,fill,paint: geometry and paint, such as a rounded rectangle filled with a color or gradient.picture,svg,lottie,raster: still images, vector art and animations.group,view,fitBox,sequence,repeat,composition: nodes that hold other nodes, lay them out or play them one after another.effect,camera,light,model,particles: effects, 3D and particles.
Can a document have only sound?
Yes: a document whose nodes are allaudio or tone nodes, alone or inside group, view,
fitBox, sequence, repeat or composition nodes, has only sound. Its canvas still sets its
length and timebase, but nothing is drawn on it. Each version is judged on its own nodes: one node
that draws, anywhere, gives the version a picture.
A version that has only sound:
- plays as audio on its links, whose HLS playlist has an audio stream (AAC, 48 kHz stereo) and no video streams;
- exports as an M4A file (
formatm4a, the default for it); - has no frames, thumbnails, storyboards or animated GIFs: asking for one returns 422
document.audio_only.
format m4a.
Assets
assets lists what the nodes use by kind, such as media, images, fonts and svgs, each with
an id that nodes refer to. A document refers to a file in its workspace as asset://<name>; put
files in the workspace first, with the API, the CLI or the MCP server’s upload_asset and
import_asset.
Can a document load media from a URL?
No: every file a document uses (video, audio, images, fonts and the rest) is a file in its workspace, with the source{type: "uri", uri: "asset://<name>"}. A source that is an
https:// or other URL, an inline data: URI, or any other kind of source is refused with
document.media_not_asset. To use a file on the web, import it
into the workspace with import_asset (POST /v1/imports); to use a file you have, upload it with
upload_asset. Then refer to it as asset://<name>.
A name the workspace doesn’t have is refused with
document.asset_not_found.
What happens to a version when I replace an asset?
Nothing: each version keeps the content its assets had when it was committed, and always renders that, even after the asset is replaced or deleted. Commit a new version to use the asset’s new content.How do I create a document?
POST /v1/documents (MCP: create_document) with the whole document as jsx. Without jsx, the
document starts empty: 10 seconds of 1920×1080 at 30 fps.
How do I edit a document?
Read it withGET /v1/documents/{id} (MCP: get_document), which returns its jsx and its
version. Then commit an edit on that version with POST /v1/documents/{id}/versions (MCP:
edit_document), giving base_version, a message saying why in one line, and either:
edits: replacements in the JSX you read, made in order. Eachold_textmust occur exactly once in the JSX as the edits before it left it; include the node’sid="…"to make it unique.jsx: the whole edited document. Every node it keeps keeps itsid.
base_version, the edit fails with version.conflict: read the
document again and redo the edit on its newest version. Send a commit_id to make the request safe
to retry.
How do I see who changed a document, and read an older version?
GET /v1/documents/{id}/versions (MCP: list_versions) lists a document’s history, newest
first, like git log. Each version has its version number, its message, committed_at, and
its author: the id and name of the API key or member who made it, via (api,
dashboard or mcp) and client, the program that sent it from its User-Agent, such as
claude-code.
limit. Pass the response’s next as before for
the page of older versions; the last page has no next. Read any version with
GET /v1/documents/{id}/versions/{version}, or get_document with its version.
In the dashboard, documents opens a document’s history:
each version with its author and message, any version, and what changed between two.
What happens when a document isn’t valid?
Rendermate checks every version it makes. JSX that can’t be read is refused withjsx.unreadable,
with the line and column. A document that reads but isn’t valid is refused with document.invalid,
whose diagnostics list each problem with its code, message, and where known the node_id,
asset_id and pointer (a JSON Pointer such as /canvas/width). Errors lists every
code.