Skip to main content
POST
Export the current document as a styled .docx (default), .pdf, .html, .md, or .txt file with full fidelity.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

authorization
string | null

Body

application/json

Unified request body for POST /v1/documents/export.

Backward-compat notes:

  • Top-level filename is retained for legacy clients that sent only { html } and relied on the filename being auto-extracted from the first

    . New clients should use options.filename — options.filename wins when both are set.

  • format defaults to "docx". Legacy callers passing format="doc" explicitly keep working during a short back-compat window.
session_id
string | null

Session ID to export from (the document is taken from the session). Required if html is omitted.

Maximum string length: 256
html
string | null

HTML content to export inline. Used instead of the session document if provided.

Maximum string length: 200000000
format
enum<string>
default:docx

Export format. One of docx (default), pdf, html, markdown, txt.

Available options:
docx,
pdf,
html,
markdown,
txt,
doc
options
ExportOptions · object

Customization (paper, margins, filename, watermark, etc.).

filename
string | null

DEPRECATED. Use options.filename. Top-level kept for legacy callers.

Maximum string length: 255
source_filename
string | null

The document's original/source filename (e.g. the name it was uploaded under). Used as the default export filename when no explicit options.filename is set, taking precedence over the first heading.

Maximum string length: 255
upload_id
string | null

ID returned by /v1/uploads (large-document upload flow, for payloads above ~25 MB). When set, the route fetches the HTML body from the uploaded payload instead of using the html field.

Maximum string length: 64

Response

Successful Response