API documentation
The public Markdown Tidy API. Convert / clean / repair markdown into HTML, plain text, PDF, DOCX, or PNG. Authenticate with an `X-API-KEY` header — create one in your dashboard at /account/api-keys. Each successful /convert call debits 1 credit from your wallet.
Base URL
https://mdtidy.comAuthentication
- apiKeyAuth
- Issued via dashboard. Prefix `mt_test_…` for sandbox, `mt_live_…` for production.
- bearerAuth
- Workspace `/v1` routes accept the same dashboard-issued key as `Authorization: Bearer mt_live_…`. First-party UI uses the session cookie instead.
Quickstart
curl -X POST https://mdtidy.com/api/v1/convert \
-H "X-API-KEY: $MARKDOWN_TIDY_KEY" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello\n\nWorld.",
"format": "html"
}'Inline output for HTML/text; base64 outputBase64 for PDF/DOCX/PNG. Every successful /convert debits 1 credit; 4xx/5xx are free.
Error format
Every 4xx/5xx shares the same envelope. The requestId is also returned as the X-Request-ID header — quote it when you contact support.
{
"error": {
"code": "invalid_request",
"message": "format: required",
"requestId": "f0c7…"
}
}Design systems
Pass designSystem on /convert to render in a typographic identity. Defaults to minimal-clean.
minimal-clean— Minimal Cleanexecutive-report— Executive Reportdeveloper-docs— Technical Doc
- Convert
- Clean, repair, and render markdown into any output format.
- Usage & credits
- Check your wallet balance, plan, and recent activity.
- Projects
- Create, list, update, and delete workspace projects.
- Folders
- Organise files into folders within a project.
- Files
- Save, read, autosave, copy, and delete markdown files.
- Sharing
- Public links and per-viewer invites for a project.
Endpoints
23 endpoints across 6 categories. Jump from the list, or narrow to a single category with the dropdown.
Convert
Clean, repair, and render markdown into any output format.
/api/v1/convertAPI keyRequest body
markdownstringrequiredThe markdown source to convert. UTF-8. Hard cap: 1 MB.
formatstringrequiredOne of:
html, text, pdf, docx, pngOutput format.
designSystemstringoptionalOne of:
minimal-clean, executive-report, developer-docsSlug of a built-in design system. Defaults to `minimal-clean`. An unknown slug returns 400 `unknown_design_system`. Available: `minimal-clean` (Minimal Clean), `executive-report` (Executive Report), `developer-docs` (Technical Doc).
settingsConvertSettingsoptionalOptional per-stage configuration envelope. Future stages (render, repair, etc.) will namespace their options under this object alongside `tidy`. Omit to accept all defaults.
pagePageSettingsoptionalOptional per-document page geometry + font scale. Every field is optional; omitted fields inherit from the design system. Geometry (paper size / orientation / margins) affects PDF, DOCX, and PNG; font scale additionally affects HTML and text. No credit cost.
Responses
- 200
- Conversion succeeded.
- 400
- Schema validation failed.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 402
- Wallet has insufficient credits to satisfy the request.
- 413
- Request body exceeds the 1 MB cap.
- 422
- Requested format is not one of the supported outputs.
- 429
- Per-key rate limit (60/min) exceeded.
- 500
- Server failed to complete the request.
Usage & credits
Check your wallet balance, plan, and recent activity.
/api/v1/usageAPI keyResponses
- 200
- Wallet balance + recent calls.
- 401
- X-API-KEY header was not supplied.
- 500
- Server failed to complete the request.
/api/v1/creditsBearer / sessionResponses
- 200
- Entitlement object.
- 500
- Server failed to complete the request.
Projects
Create, list, update, and delete workspace projects.
/api/v1/projectsBearer / sessionParameters
scopequerystring
Responses
- 200
- Project list.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projectsBearer / sessionRequest body
namestringrequireddescriptionstringoptional
Responses
- 201
- Project created.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 409
- Name collision, stale write, or a resource limit was reached.
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}Bearer / sessionParameters
idpathstring · uuidrequiredinclude_archivedqueryboolean
Responses
- 200
- Project + folders + files.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}Bearer / sessionParameters
idpathstring · uuidrequired
Request body
namestringoptionaldescriptionstring | nulloptionalarchivedbooleanoptional
Responses
- 200
- Updated project.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}Bearer / sessionParameters
idpathstring · uuidrequired
Responses
- 200
- Deleted.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.
Folders
Organise files into folders within a project.
/api/v1/projects/{id}/foldersBearer / sessionParameters
idpathstring · uuidrequired
Request body
namestringrequiredparent_folder_idstring · uuid | nulloptionalOptional parent folder (nesting). When set, the folder is created inside it; omit/null for the project root. Must belong to the addressed project.
Responses
- 201
- Folder created.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/folders/{id}Bearer / sessionParameters
idpathstring · uuidrequired
Request body
namestringrequired
Responses
- 200
- Updated folder.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/folders/{id}Bearer / sessionParameters
idpathstring · uuidrequiredcascadequerybooleanHard-delete the whole subtree instead of refusing on active files.
Responses
- 200
- Deleted.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 429
- Per-key rate limit (60/min) exceeded.
Files
Save, read, autosave, copy, and delete markdown files.
/api/v1/filesBearer / sessionParameters
Idempotency-Keyheaderstring
Request body
project_idstring · uuidrequiredfolder_idstring · uuid | nulloptionalnamestringrequiredcontentstringrequired
Responses
- 201
- File created.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 402
- Wallet has insufficient credits to satisfy the request.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 413
- Request body exceeds the 1 MB cap.
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/files/{id}Bearer / sessionParameters
idpathstring · uuidrequired
Responses
- 200
- File metadata + content pointers.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/files/{id}Bearer / sessionParameters
idpathstring · uuidrequiredIf-MatchheaderstringLegacy optimistic-lock precondition (quoted version, e.g. `"3"`). Accepted, but prefer the `version` body field — a CDN may evaluate this reserved conditional header at the edge and return 412.
Request body
contentstringoptionalnamestringoptionalfolder_idstring · uuid | nulloptionalarchivedbooleanoptionalversionintegeroptionalOptimistic-lock precondition for content writes; recommended over the If-Match header (which a CDN may 412 at the edge).
Responses
- 200
- Updated file.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 412
- Edge-injected: a CDN evaluated the `If-Match` request header and rejected it (the origin never returns 412, and the write may have already committed). Use the `version` body field instead.
- 413
- Request body exceeds the 1 MB cap.
- 422
- Request body failed validation.
- 428
- A content write omitted the required If-Match / version precondition.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/files/{id}Bearer / sessionParameters
idpathstring · uuidrequired
Responses
- 200
- Deleted.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/files/{id}/copyBearer / sessionParameters
idpathstring · uuidrequiredIdempotency-Keyheaderstring
Responses
- 201
- File copied.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 402
- Wallet has insufficient credits to satisfy the request.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
Sharing
Public links and per-viewer invites for a project.
/api/v1/projects/{id}/share/publicBearer / sessionParameters
idpathstring · uuidrequiredIdempotency-Keyheaderstring
Responses
- 200
- Public link enabled.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 402
- Wallet has insufficient credits to satisfy the request.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}/share/publicBearer / sessionParameters
idpathstring · uuidrequired
Responses
- 200
- Public link removed.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}/share/public/regenerateBearer / sessionParameters
idpathstring · uuidrequiredIdempotency-Keyheaderstring
Responses
- 200
- New public link issued.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 402
- Wallet has insufficient credits to satisfy the request.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}/share/invitesBearer / sessionParameters
idpathstring · uuidrequiredIdempotency-Keyheaderstring
Request body
emailsstring[]requiredUp to 25 viewer emails. 1 credit per call; already-invited emails are free.
Responses
- 200
- Invitees added; share is now restricted.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 402
- Wallet has insufficient credits to satisfy the request.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 409
- Name collision, stale write, or a resource limit was reached.
- 413
- Request body exceeds the 1 MB cap.
- 422
- Request body failed validation.
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}/share/invites/{email}Bearer / sessionParameters
idpathstring · uuidrequiredemailpathstring · emailrequired
Responses
- 200
- Invitee removed (or already absent).
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.
/api/v1/projects/{id}/share/privateBearer / sessionParameters
idpathstring · uuidrequired
Responses
- 200
- Project is now private.
- 401
- X-API-KEY is malformed, unknown, or revoked.
- 404
- Resource not found, or not owned by the caller (IDOR-safe).
- 429
- Per-key rate limit (60/min) exceeded.