POST/v1/convert

Convert

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

ParameterTypeRequiredDefaultDescription
markdownstringYesMarkdown content to convert (max 100KB)
destinationstringNo"generic"Target format: google-docs, word, slack, onenote, email, plain-text, generic, html
template_idstringNo"swiss"Template ID for styling. See Templates
theme_modestringNo"light"Color theme: "light" or "dark"

Response

Returns the converted content as HTML and plain text.

FieldTypeDescription
htmlstringConverted HTML output, styled for the target destination
plain_textstringPlain text version with no formatting
destinationstringThe destination that was used
template_idstringThe template that was applied
theme_modestringThe theme mode that was used

Errors

StatusCodeDescription
400validation_errorMissing markdown field or invalid parameters
401unauthorizedMissing or invalid API key
429rate_limitedRate limit or monthly quota exceeded
500internal_errorUnexpected 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"
}