---
title: "Convert Markdown to HTML"
method: POST
path: "/markdown-to-html"
tags: ["Documents"]
---

# Convert Markdown to HTML

`POST /markdown-to-html`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/markdown-to-html`
- Auth: API key in header `x-api-key`

Converts Markdown (CommonMark + GFM tables/strikethrough) to plain HTML. The output is not sanitized: raw HTML inside the Markdown passes through unchanged.

Costs 1 credit per call.

## Request body

- object
  - `markdown` string, required: The Markdown text to convert (CommonMark plus GitHub-style tables and strikethrough), up to 2 MB.
  - `output` 'json' | 'html': How to return the HTML: "json" (the HTML inside the JSON response) or "html" (the HTML itself as the response body, text/html). Default: json when the request is JSON, html when the Markdown was sent as raw text.

## Response `200`

Result.

- object
  - `success` boolean
  - `html` string
  - `meta` object
    - `used` integer: Credits used this month, after this call.
    - `remaining` integer, nullable: Credits left this month (null = unlimited).
    - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

[API](https://skmtc.dev/cofferdock/apis/cofferdock-api.md) · [All operations](https://skmtc.dev/cofferdock/apis/cofferdock-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cofferdock/apis/cofferdock-api/revisions/b57aa000d33a?raw)
