Skip to main content
POST
/
v1
/
documents
/
export
Export the current document as a styled .doc, .docx, .pdf, or .html file with full fidelity.
curl --request POST \
  --url https://api.example.com/v1/documents/export \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "<string>",
  "html": "<string>",
  "filename": "<string>",
  "format": "doc"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

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
session_id
string | null

Session ID to export document from (Mode B). Required if html is not provided.

Maximum string length: 256
html
string | null

HTML content to convert to DOCX (Mode A). If provided, this is used instead of the session document.

Maximum string length: 50000000
filename
string | null

Custom filename for the exported file (without extension). Auto-detected from first heading if not provided.

Maximum string length: 255
format
string | null
default:doc

Export format: 'doc' (Word-compatible HTML — pixel-perfect formatting fidelity) or 'docx' (native Open XML — better for programmatic processing). Default: 'doc'.

Maximum string length: 10

Response

Successful Response