upload_docx
Upload a DOCX file for conversion or modification.
docx.sh exposes the same engine over MCP and REST. Authenticate with a Bearer token — generate one in Agents after signing up.
Authorization: Bearer <token>https://docx.sh/api/v1https://docx.sh/mcpConnect via Agents setup (Cursor, Claude Code, Codex). Each tool call counts toward your monthly MCP/API limit except HTML/DOCX downloads.
{
"mcpServers": {
"docxtohtml": {
"url": "https://docx.sh/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}
upload_docxUpload a DOCX file for conversion or modification.
convert_docxConvert an uploaded document to HTML preview and full HTML.
modify_docxApply structured element operations and return a new derived document as DOCX or HTML.
get_docx_contentInspect elements for editing: paragraph or run anchors, table coordinates, optional comments and tracked changes.
list_documentsList your active (non-expired) documents.
get_documentGet document metadata and authorized download paths.
get_htmlGet HTML metadata for a document (use API paths to download bodies).
delete_documentDelete a document and its generated files.
HTTP JSON API for scripts, CI, and backends.
# Upload curl -X POST "https://docx.sh/api/v1/documents" \ -H "Authorization: Bearer <token>" \ -F "file=@document.docx" # Convert to HTML curl -X POST "https://docx.sh/api/v1/documents/DOCUMENT_ID/convert" \ -H "Authorization: Bearer <token>" # Download HTML curl "https://docx.sh/api/v1/documents/DOCUMENT_ID/html" \ -H "Authorization: Bearer <token>" -o output.html
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/documents |
List active documents. |
| POST | /api/v1/documents |
Upload a DOCX file (multipart form field: file). |
| GET | /api/v1/documents/:id |
Get document metadata. |
| DELETE | /api/v1/documents/:id |
Delete a document. |
| POST | /api/v1/documents/:id/convert |
Convert document to HTML. |
| POST | /api/v1/documents/:id/modify |
Modify document; returns a new derived document. |
| GET | /api/v1/documents/:id/content |
Inspect elements (mode=paragraphs|runs, include=comments,revisions). |
| GET | /api/v1/documents/:id/preview |
Download first-page HTML preview. |
| GET | /api/v1/documents/:id/html |
Download full HTML (?inline=true for inline). |
| GET | /api/v1/documents/:id/zip |
Download HTML bundle as ZIP. |
| GET | /api/v1/documents/:id/docx |
Download modified DOCX output. |
modify_docx / POST …/modify creates a new document.
Use get_docx_content first to discover element anchors (wt:N, table paths).
POST https://docx.sh/api/v1/documents/DOCUMENT_ID/modify
Authorization: Bearer <token>
Content-Type: application/json
{
"output_format": "docx",
"operations": [
{ "type": "replace_paragraph", "at": "wt:0", "text": "Updated clause." },
{ "type": "track_insert", "at": "wt:0", "text": "Proposed addition.", "author": "Agent" },
{ "type": "add_comment", "at": "wt:0", "text": "Please review.", "author": "Agent" }
]
}
GET …/docxGET …/html or preview pathssource_document_id linking to the original