Convert
Convert Markdown to styled HTML for any destination, without creating or storing a document.
The convert endpoint renders Markdown into styled HTML optimized for a specific destination. Use this when you need rendered output without persisting a document.
Tip
If you need to store the document for later editing or publishing, use the Create Document endpoint instead.
Endpoint
POST
/v1/convertConvert Markdown to styled HTML. Does not create or store a document.
Parameters
| Parameter | Type | Description |
|---|---|---|
markdownrequired | string | Markdown content to convert (max 100KB) |
destination | string | Target format. One of: google-docs, word, slack, onenote, email, plain-text, generic, htmlDefault: generic |
template_id | string | Template ID for styling (62 available)Default: swiss |
theme_mode | string | Color theme: light or darkDefault: light |
Request
bash
curl -X POST https://api.unmarkdown.com/v1/convert \
-H "Authorization: Bearer um_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello World\n\nThis is **bold** and this is *italic*.",
"destination": "google-docs",
"template_id": "swiss"
}'Response
json
{
"html": "<h1>Hello World</h1><p>This is <strong>bold</strong> and this is <em>italic</em>.</p>",
"plain_text": "HELLO WORLD\n\nThis is bold and this is italic.",
"destination": "google-docs",
"template_id": "swiss",
"theme_mode": "light"
}Error Response
json
{
"error": {
"code": "invalid_body",
"message": "\"markdown\" field is required",
"status": 400
}
}Status Codes
| Status | Description |
|---|---|
| 200 | Conversion successful |
| 400 | Invalid body or validation error (missing markdown, exceeds 100KB, invalid destination, unknown template) |
| 401 | Missing or invalid API key |
| 429 | Rate limit or quota exceeded |
| 500 | Conversion pipeline error |
Destination Formats
The destination parameter controls how the HTML is structured for optimal pasting or display:
- google-docs: Inline styles with -aw-style-name attributes for Google Docs paste fidelity
- word: Inline styles with mso-style-name attributes for Microsoft Word
- slack: Converts to Slack mrkdwn format (bold, italic, code, lists, links)
- onenote: Structured HTML optimized for OneNote paste
- email: Fully inlined CSS for email client compatibility
- plain-text: Stripped to plain text with preserved structure
- generic: Clean HTML with template CSS (default)
- html: Raw HTML output without template styling