> ## Documentation Index
> Fetch the complete documentation index at: https://rendermate.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Documents

> The MCP tools for documents.

## `create_document`

Create a document: a video edit with versions, like a git repository. Starts empty (10 seconds of 1920x1080 at 30 fps), or from a whole document written as JSX: `export default (<timeline canvas={{...}} schemaVersion={...}>...</timeline>)`, where each node is an element whose tag is its type, with an id, its fields as attributes and its children inside. Times are seconds, colours "#rrggbb", and Doc.keys(\[seconds, value, easing], ...) is a keyframe curve. The JSX get\_document returns starts with a comment that explains the whole notation ([https://rendermate.com/docs/documents](https://rendermate.com/docs/documents.md)). Write the document out whole, without Doc.cut or Doc.more. edit\_document's description shows how to write each kind of node and asset. To start from scratch, create the document empty, then edit it with jsx: the whole document, keeping the canvas get\_document returned.

REST: [`POST /v1/documents`](https://rendermate.com/docs/api-reference/documents/create-document)

**commit\_id** `string`

A UUID that makes the create safe to send again: sent again with the same one, it answers with the document it made instead of making another. The `Idempotency-Key` header does the same.

**jsx** `string`

The whole document to start from, written as JSX ([https://rendermate.com/docs/documents](https://rendermate.com/docs/documents.md)): `export default (<timeline canvas={{…}}>…</timeline>)`. When absent, the document starts empty: 10 seconds of 1920×1080 at 30 fps.

**message** `string`

The first commit's message.

**name** `string`

A name people recognize it by, such as "Q3 update"; at most 200 characters.

**project\_id** `string`

The project to put it in, `prj_…`; the workspace's default project when absent.

## `create_preview`

A live preview page of a version or alias of a document, for showing a person. A version's preview never changes; an alias's follows it as it moves. The URL works for 12 hours.

REST: [`POST /v1/documents/{document_id}/previews`](https://rendermate.com/docs/api-reference/documents/create-preview)

**alias** `string`

An alias, such as `latest`; `latest` when neither this nor `version` is given.

**document\_id** `string` *required*

The document to preview.

**version** `integer`

A version, by number.

## `delete_alias`

Remove an alias from a document. The versions stay; links that follow the alias stop playing.

REST: [`DELETE /v1/documents/{document_id}/aliases/{alias}`](https://rendermate.com/docs/api-reference/documents/delete-alias) · destructive, idempotent

**alias** `string` *required*

The alias to remove. Links that follow it stop playing.

**document\_id** `string` *required*

## `delete_document`

Delete a document with its whole history, aliases and links. Its links stop playing. This can't be undone.

REST: [`DELETE /v1/documents/{document_id}`](https://rendermate.com/docs/api-reference/documents/delete-document) · destructive, idempotent

**document\_id** `string` *required*

The document to delete, with all its versions, aliases and links.

## `edit_document`

Change a document by committing an edit on base\_version, which makes a new version. Give edits, exact replacements in the JSX get\_document returned for base\_version: each old\_text must occur exactly once, spaces and line breaks included (copy it from that JSX, and include the node's id="..." to make it unique), and they apply in order. Or give jsx, the whole edited document: do that to add the first nodes to an empty document, whose `<timeline ... />` closes itself. Long strings and arrays the JSX cut (Doc.cut, ...Doc.more) stay as they are when left in place. If another commit landed after base\_version, this fails with version.conflict: read the document again and redo the edit.  How to write what most videos need ([https://rendermate.com/docs/documents](https://rendermate.com/docs/documents.md) has the rest): - Every node has an `id="..."`, unique and without `/`, and `common={{start: 0, duration: 3, order: "a1"}}`: its window in seconds, which may not reach past the canvas's duration, and its paint order among its siblings (`"a0"` is under `"a1"`). - Files are declared before `export default`, each with an id that nodes use and a workspace asset, uploaded with upload\_asset or imported with import\_asset first: `export const assets = {fonts: [{id: "inter", family: "Inter", weight: 700, style: "normal", source: {type: "uri", uri: "asset://brand/Inter-Bold.ttf"}}], images: [{id: "logo", source: {type: "uri", uri: "asset://brand/logo.png"}}], media: [{id: "intro", source: {type: "uri", uri: "asset://launch/intro.mp4"}}]};` - Text needs a font: a .ttf or .otf asset declared in `fonts`. `<text id="title" common={{start: 0, duration: 3, order: "a3"}} content={{type: "paragraph", text: "Hello world", position: {x: 120, y: 860}, width: 1680, align: "left", style: {fontId: "inter", fontSize: 96, color: "#ffffff"}}} />` - A background colour: `<fill id="bg" common={{order: "a0"}} paint={{style: "fill", source: {type: "solid", color: "#10233f"}}} />` - A shape: `<shape id="dot" common={{start: 0, duration: 3, order: "a2"}} geometry={{type: "circle", center: {x: 960, y: 540}, radius: 100}} paint={{style: "fill", source: {type: "solid", color: "#ffd84d"}}} />`. `geometry` can also be `{type: "rect", rect: {x, y, width, height}}` or `{type: "oval", rect: {...}}`. - A video, or an image from `images`: `<media id="clip" common={{start: 0, duration: 4, order: "a1"}} assetId="intro" destination={{x: 0, y: 0, width: 1920, height: 1080}} fit="cover" sampling={{filter: "linear", mipmap: "linear"}} sourceIn={1} />`. `fit="contain"` fits it inside `destination`; `sourceIn` is where in the file it starts, in seconds. - Sound: `<audio id="music" common={{start: 0, duration: 6}} assetId="intro" gain={0.3} />` - Animation: a number becomes keyframes, `Doc.keys([seconds, value], ...)` timed from the node's start, such as `opacity: Doc.keys([0, 0], [0.5, 1])` in `common` or `radius: Doc.keys([0, 20], [3, 120])`. - A field the format doesn't have is refused with jsx.unreadable, whose message says what that place takes.

REST: [`POST /v1/documents/{document_id}/versions`](https://rendermate.com/docs/api-reference/documents/edit-document)

**base\_version** `integer` *required*

The version the edit was made on, as get\_document returned it: the edit is committed only if that's still the newest version.

**commit\_id** `string`

A UUID that makes the commit safe to send again: sent again with the same one, it answers with the version it made instead of making another. The `Idempotency-Key` header does the same.

**document\_id** `string` *required*

**edits** `array`

Replacements in the JSX of `base_version`, made in order. Give these or `jsx`.

**jsx** `string`

The whole document as edited JSX, in place of `edits`. Every node it keeps keeps its `id`.

**message** `string` *required*

Why the document changes, in one line, like a git commit message: "Shorten the intro to 4 seconds", not "update document".

## `fork_document`

Copy a document at one version into a new document with its own history, for a variant, an experiment, or a new video from a template. The original doesn't change.

REST: [`POST /v1/documents/{document_id}/fork`](https://rendermate.com/docs/api-reference/documents/fork-document)

**alias** `string`

An alias, such as `latest`; `latest` when neither this nor `version` is given.

**document\_id** `string` *required*

**name** `string`

The new document's name; the original's when absent.

**project\_id** `string`

The project to put it in; the original's when absent.

**version** `integer`

A version, by number.

## `get_document`

Read a document at one version (the latest by default) as JSX, with the version number. The JSX starts with a comment that explains its notation. Read it before editing: edit\_document needs that version as its base\_version, and its edits replace text in this JSX.

REST: [`GET /v1/documents/{document_id}`](https://rendermate.com/docs/api-reference/documents/get-document) · read-only

**alias** `string`

An alias, such as `latest`; `latest` when neither this nor `version` is given.

**document\_id** `string` *required*

**version** `integer`

A version, by number.

## `get_frame`

Look at a document: a still image of one moment of a version, rendered as it will play. Use it to check an edit. It's a render, so it costs credits the first time; the same frame again is free. Each frame is also saved as an asset in the workspace's renders/ folder.

REST: [`POST /v1/documents/{document_id}/frames`](https://rendermate.com/docs/api-reference/documents/get-frame)

**alias** `string`

An alias, such as `latest`; `latest` when neither this nor `version` is given.

**document\_id** `string` *required*

**format** `string`

`jpg` (the default), `png` or `webp`.

**height** `integer`

The image's height in pixels.

**time** `number` *required*

The moment to show, in seconds from the start. It shows the frame the moment falls in, and a moment past the end shows the last frame.

**version** `integer`

A version, by number.

**width** `integer`

The image's width in pixels; the video's when neither width nor height is given. With only one of them, the other follows the video's aspect ratio; with both, the image is the largest that fits in them.

## `list_documents`

List the workspace's documents, newest first, with each one's latest version.

REST: [`GET /v1/documents`](https://rendermate.com/docs/api-reference/documents/list-documents) · read-only

**after** `string`

The `next` of the previous page.

**limit** `integer`

How many to return, up to 100; 100 when absent.

**project\_id** `string`

Only this project's documents, `prj_…`; every project's when absent.

## `list_versions`

List a document's versions, newest first: each one's number, author, message and time, like git log.

REST: [`GET /v1/documents/{document_id}/versions`](https://rendermate.com/docs/api-reference/documents/list-versions) · read-only

**before** `integer`

Only versions before this one: the `next` of the previous page.

**document\_id** `string` *required*

**limit** `integer`

How many to return, up to 100; 50 when absent.

## `purge_document`

Delete a document's stored renders, of every version, and clear the CDN's cached copies of the video, thumbnails, storyboards and GIFs of every link to it, within a minute. The next view renders them again, billed as new renders, except video and audio segments whose content is unchanged and still stored, which are reused. Finished exports of the document stop downloading (404): export again for a new download.

REST: [`POST /v1/documents/{document_id}/purge`](https://rendermate.com/docs/api-reference/documents/purge-document) · destructive, idempotent

**document\_id** `string` *required*

The document, `doc_…`.

## `set_alias`

Point an alias of a document at a version, creating the alias or moving it. Links that follow the alias play the new version from then on.

REST: [`PUT /v1/documents/{document_id}/aliases/{alias}`](https://rendermate.com/docs/api-reference/documents/set-alias) · idempotent

**alias** `string` *required*

The alias, such as `approved` or `client-review`. `latest` is built in and can't be set.

**document\_id** `string` *required*

**version** `integer` *required*

The version it points at.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.