POST
/v1/convertConvert
Convert markdown to styled HTML for any destination.
Convert markdown to destination-specific HTML. The conversion is stateless: no document is created or saved. Use this when you need formatted output for pasting into other applications.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
markdown | string | Yes | Markdown content to convert (max 100KB) | |
destination | string | No | "generic" | Target format: google-docs, word, slack, onenote, email, plain-text, generic, html |
template_id | string | No | "swiss" | Template ID for styling. See Templates |
theme_mode | string | No | "light" | Color theme: "light" or "dark" |
Response
Returns the converted content as HTML and plain text.
| Field | Type | Description |
|---|---|---|
html | string | Converted HTML output, styled for the target destination |
plain_text | string | Plain text version with no formatting |
destination | string | The destination that was used |
template_id | string | The template that was applied |
theme_mode | string | The theme mode that was used |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Missing markdown field or invalid parameters |
| 401 | unauthorized | Missing or invalid API key |
| 429 | rate_limited | Rate limit or monthly quota exceeded |
| 500 | internal_error | Unexpected server error |
curl -X POST https://api.unmarkdown.com/v1/convert \
-H "Authorization: Bearer um_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello World\n\nThis is **bold** and this is *italic*.",
"destination": "google-docs",
"template_id": "swiss",
"theme_mode": "light"
}'
const response = await fetch(
"https://api.unmarkdown.com/v1/convert",
{
method: "POST",
headers: {
"Authorization": "Bearer um_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
markdown: "# Hello World\n\nThis is **bold** and this is *italic*.",
destination: "google-docs",
template_id: "swiss",
theme_mode: "light",
}),
}
);
const data = await response.json();
console.log(data.html);
import requests
response = requests.post(
"https://api.unmarkdown.com/v1/convert",
headers={"Authorization": "Bearer um_your_key_here"},
json={
"markdown": "# Hello World\n\nThis is **bold** and this is *italic*.",
"destination": "google-docs",
"template_id": "swiss",
"theme_mode": "light",
},
)
data = response.json()
print(data["html"])
Response
{
"html": "<div class=\"template-preview\"><h1>Hello World</h1><p>This is <strong>bold</strong> and this is <em>italic</em>.</p></div>",
"plain_text": "Hello World\n\nThis is bold and this is italic.",
"destination": "google-docs",
"template_id": "swiss",
"theme_mode": "light"
}