Export the current document as a styled .docx (default), .pdf, .html, .md, or .txt file with full fidelity.
Round-trips the document through the original docx renderer, preserving tables, borders, shading, alternating row colors, headers, footers, fonts, inline styling, and embedded images. Two modes: pass html directly to export ad-hoc content, OR pass session_id to export the session’s current state. Format options: ‘docx’ (default, native Open XML, best for programmatic processing or mail merge), ‘pdf’, ‘html’, ‘markdown’, or ‘txt’ (‘doc’ is a legacy Word-compatible HTML alias). Fidelity is the differentiator vs naive HTML to docx converters.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
Unified request body for POST /v1/documents/export.
Backward-compat notes:
- Top-level
filenameis 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. formatdefaults to "docx". Legacy callers passing format="doc" explicitly keep working during a short back-compat window.
Session ID to export from (the document is taken from the session). Required if html is omitted.
256HTML content to export inline. Used instead of the session document if provided.
200000000Export format. One of docx (default), pdf, html, markdown, txt.
docx, pdf, html, markdown, txt, doc Customization (paper, margins, filename, watermark, etc.).
DEPRECATED. Use options.filename. Top-level kept for legacy callers.
255ID 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.
64Response
Successful Response

