v1
mcp

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. When called as an MCP tool, binary formats (docx/pdf/doc) are returned as a short-lived signed download_url in a JSON envelope (fetch it to get the file); text formats (html/markdown/txt) are returned inline.

post/v1/documents/export

Request

  • Base URL: https://api.superdocs.app
  • URL: https://api.superdocs.app/v1/documents/export
  • Auth: HTTP bearer

Headers

authorizationstring nullable

Request body

session_idstring nullable

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

htmlstring nullable

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

format'docx' | 'pdf' | 'html' | 'markdown' | 'txt' | 'doc'

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

filenamestring nullable

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

source_filenamestring nullable

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.

upload_idstring nullable

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.

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.