Prerequisites
1. Get your API key
Your API key
mddoc_clmvMFXmPUJ6xK9Tq...2. Find a template and mapping
List templates
curl https://api.mddoc.app/api/v1/templates \
-H "Authorization: Bearer mddoc_YOUR_KEY"List mappings for a template
curl "https://api.mddoc.app/api/v1/mappings?template_id=TEMPLATE_ID" \
-H "Authorization: Bearer mddoc_YOUR_KEY"3. Convert markdown to Word
Convert markdown
curl -X POST https://api.mddoc.app/api/v1/convert \
-H "Authorization: Bearer mddoc_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Project Brief\n\nThis is the overview.\n\n## Goals\n\n- Ship faster\n- Reduce manual formatting",
"template_id": "your-template-uuid",
"mapping_id": "your-mapping-uuid",
"filename": "project-brief",
"response_format": "json"
}'Response
{
"conversion_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "completed",
"filename": "project-brief.docx",
"download_url": "/api/v1/conversions/a1b2c3d4-.../download",
"warnings": [],
"stats": {
"headings": 2,
"paragraphs": 1,
"lists": 1,
"tables": 0,
"code_blocks": 0,
"images": 0
},
"created_at": "2026-02-25T10:30:00Z"
}4. Download the file
Download
curl https://api.mddoc.app/api/v1/conversions/CONVERSION_ID/download \
-H "Authorization: Bearer mddoc_YOUR_KEY" \
-o project-brief.docxLanguage examples
JavaScript / Node.js
javascript
const response = await fetch("https://api.mddoc.app/api/v1/convert", {
method: "POST",
headers: {
"Authorization": "Bearer mddoc_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
markdown: "# Hello World\n\nConverted via the API.",
template_id: "your-template-uuid",
mapping_id: "your-mapping-uuid",
}),
});
// Default response is binary — save directly
const buffer = await response.arrayBuffer();
fs.writeFileSync("output.docx", Buffer.from(buffer));Python
python
import requests
response = requests.post(
"https://api.mddoc.app/api/v1/convert",
headers={"Authorization": "Bearer mddoc_YOUR_KEY"},
json={
"markdown": "# Hello World\n\nConverted via the API.",
"template_id": "your-template-uuid",
"mapping_id": "your-mapping-uuid",
},
)
with open("output.docx", "wb") as f:
f.write(response.content)