Quick Start
SDK Usage
Useclient.create_document() to create a DOCX from markdown:
SDK Method Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
markdown | str | Required | Markdown content with optional track changes markup |
output_format | str | "docx" | Output format (only "docx" is supported) |
webhook_url | str | None | Optional webhook URL for completion notification |
save_output | str/Path | None | File path to save the output DOCX |
max_polls | int | 300 | Maximum polling attempts |
poll_interval | int | 1 | Seconds between polls |
SDK Result Fields
| Field | Type | Description |
|---|---|---|
success | bool | Whether document creation succeeded |
status | str | "complete" when done |
output_format | str | "docx" |
output_base64 | str | Base64-encoded DOCX file |
runtime | float | Processing time in seconds |
page_count | int | Pages in the generated document |
cost_breakdown | dict | Cost details |
error | str | Error message if creation failed |
How It Works
- Send markdown content with optional track changes markup
- The API converts it to a DOCX file with proper Word formatting
- Track changes tags become native Word revision marks
- The DOCX file is returned as a base64-encoded string
Track Changes Markup
Insertions
Mark inserted text with<ins> tags:
| Attribute | Required | Description |
|---|---|---|
data-revision-author | Yes | Author name for the insertion |
data-revision-datetime | Yes | ISO 8601 timestamp (e.g., 2024-01-15T10:00:00Z) |
Deletions
Mark deleted text with<del> tags:
| Attribute | Required | Description |
|---|---|---|
data-revision-author | Yes | Author name for the deletion |
data-revision-datetime | Yes | ISO 8601 timestamp |
Comments
Add comments with<comment> tags:
| Attribute | Required | Description |
|---|---|---|
data-comment-author | Yes | Author/reviewer name |
text | Yes | The comment text |
data-comment-datetime | No | ISO 8601 timestamp (defaults to current time) |
data-comment-initial | No | Author initials (auto-generated from name if omitted) |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
markdown | string | Yes | Markdown content with optional track changes markup |
output_format | string | No | Output format (currently only docx is supported) |
webhook_url | string | No | Webhook URL to notify when processing completes |
Response
The response follows the standard async pattern — submit, then poll: Initial response:| Field | Type | Description |
|---|---|---|
status | string | processing or complete |
success | bool | Whether document creation succeeded |
output_format | string | docx |
output_base64 | string | Base64-encoded DOCX file |
runtime | float | Processing time in seconds |
page_count | int | Pages in the generated document |
cost_breakdown | object | Cost details |
error | string | Error message if creation failed |
Full Example
A contract with insertions, deletions, and reviewer comments:Use Cases
- Legal document generation — create contracts with tracked revisions
- Contract redlining — mark up agreements with insertions and deletions
- Collaborative review — add reviewer comments to documents
- Document automation — generate Word documents from templates with dynamic content
Next Steps
Track Changes Extraction
Extract track changes from existing Word documents
Document Conversion
Convert documents to markdown, HTML, or JSON
Webhooks
Get notified when document creation completes
Pipelines
Chain processors into versioned, reusable pipelines.