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
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.
Response
Successful Response