Skip to main content
POST
save document

Authorizations

Authorization
string
header
required

An API key (es_live_…) from Settings, under API keys, or an OAuth access token.

Headers

Idempotency-Key
string

Retry a paid dispatch safely: the same key returns the job already dispatched instead of charging again.

x-workspace-id
string

The workspace this one call acts in, when it is not the key's own.

Body

application/json
content
string
required

The whole document body, markdown or plain text, up to 200k bytes (Hebrew and Arabic take two bytes a letter, emoji four). On rewrite this replaces the body entirely.

Minimum string length: 1
name
string

Document title (becomes the file name). Required when creating; ignored on rewrite.

Required string length: 1 - 120
ref
string

An existing document to rewrite in place: the ones saved here and uploaded .md/.txt files; PDFs and Office files are viewed, not edited. Omit to create a new one.

if_revision
integer

The revision read_document returned. A rewrite needs it, or replace; one that is out of date fails with revision_conflict rather than overwriting an edit you have not seen.

replace
boolean

Rewrite over whatever the document says now, without reading it first. Otherwise pass if_revision.

folder
string

Destination folder: path ("campaigns/july") or id. Create only.

context
string

Optional: one sentence shown to the user beside this action.

Maximum string length: 600

Response

Done, or a job started for work that runs longer (follow it with get_jobs).

ok
any
required
data
object
required
meta
object
required
media
object[]