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/publishCreate a new document and publish it in one request.
Parameters
| Parameter | Type | Description |
|---|---|---|
contentrequired | string | Markdown content (max 100KB) |
title | string | Document titleDefault: Untitled |
template_id | string | Template ID for stylingDefault: swiss |
theme_mode | string | Color theme: light or dark |
slug | string | Custom URL slug (Pro only) |
description | string | Page 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
| Status | Description |
|---|---|
| 201 | Document created and published successfully |
| 400 | Invalid body, missing content, exceeds 100KB, unknown template, or invalid slug |
| 401 | Missing or invalid API key |
| 403 | Free tier document limit or Pro-only feature (custom slug) |
| 409 | Slug already taken |
| 429 | Rate limit or quota exceeded |
| 500 | Render error or internal server error |