---
title: "Create and publish a document in one call"
method: POST
path: "/documents/publish"
---

# Create and publish a document in one call

`POST /documents/publish`

## Request

- Base URL: `https://api.unmarkdown.com/v1`
- URL: `https://api.unmarkdown.com/v1/documents/publish`
- Auth: HTTP bearer

Creates a new document and immediately publishes it. Returns the published URL. This is the most common endpoint for programmatic publishing. Equivalent to calling POST /documents followed by POST /documents/{id}/publish.

## Request body

- CreateAndPublishRequest
  - `content` string, required: Markdown content
  - `title` string
  - `template_id` string
  - `theme_mode` 'light' | 'dark'
  - `slug` string: Custom URL slug (Pro only)
  - `description` string

## Response `201`

Document created and published

- PublishResponse
  - `id` string, uuid
  - `title` string
  - `published_url` string, uri
  - `published_at` string, date-time
  - `template_id` string
  - `word_count` integer
  - `reading_time_minutes` integer

## Other responses

- `400`: Invalid request
- `401`: Authentication required
- `403`: Insufficient permissions or tier
- `409`: Slug conflict
- `429`: Rate limit or quota exceeded
- `500`: Internal server error

---

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