Skip to main content
POST
Edit document

Authorizations

Authorization
string
header
required

An API key from the dashboard, such as sk_live_…. It acts in its workspace.

Path Parameters

document_id
string
required

Body

application/json
base_version
integer<uint64>
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.

Required range: x >= 0
message
string
required

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

commit_id
string | null

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.

edits
object[]

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

jsx
string | null

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

Response

Created

commit_id
string
required

The commit that made the version.

id
string
required

The document, doc_….

sha256
string
required

SHA-256 of the document as canonical JSON.

version
integer<uint64>
required

The version's number: 1 for the document as created, one more for each commit.

Required range: x >= 0
author
object | null

The API key, or the member, that made it.

committed_at
string | null

RFC 3339.

jsx
string | null

The Rendermate document at this version, written as JSX; only when it's read, not when it's created or committed. Edit it with edit_document, giving this version as base_version.

message
string | null

What the commit changes and why.