UnmarkdownDocs

Create and Publish

Create a new document and publish it to the web in a single request.

This convenience endpoint combines document creation and publishing into one step. It creates a new document in your account, applies the specified template, and immediately publishes it.

Important
Free accounts are limited to 5 documents and cannot use custom slugs. Attempting to exceed the document limit or use Pro-only features returns a 403 error.
POST/v1/documents/publish

Create a new document and publish it in one request.

Parameters

ParameterTypeDescription
contentrequiredstringMarkdown content (max 100KB)
titlestringDocument titleDefault: Untitled
template_idstringTemplate ID for stylingDefault: swiss
theme_modestringColor theme: light or dark
slugstringCustom URL slug (Pro only)
descriptionstringPage meta description

Request

bash
curl -X POST https://api.unmarkdown.com/v1/documents/publish \
  -H "Authorization: Bearer um_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Release Notes v2.1",
    "content": "# Release Notes\n\n## v2.1.0\n\nNew features and improvements.",
    "template_id": "swiss",
    "slug": "release-notes-v2"
  }'

Response

json
{
  "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "title": "Release Notes v2.1",
  "published_url": "https://unmarkdown.com/u/leonard/release-notes-v2",
  "published_at": "2026-02-17T10:30:00Z",
  "template_id": "swiss",
  "word_count": 12,
  "reading_time_minutes": 1
}

Error Response

json
{
  "error": {
    "code": "validation_error",
    "message": "\"content\" field is required",
    "status": 400
  }
}

Status Codes

StatusDescription
201Document created and published successfully
400Invalid body, missing content, exceeds 100KB, unknown template, or invalid slug
401Missing or invalid API key
403Free tier document limit or Pro-only feature (custom slug)
409Slug already taken
429Rate limit or quota exceeded
500Render error or internal server error