---
title: "Publish a document"
method: POST
path: "/documents/{id}/publish"
---

# Publish a document

`POST /documents/{id}/publish`

## Request

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

Publishes an existing document, making it accessible via a public URL. If already published, updates the published version. The document must exist and belong to you.

## Path parameters

- `id` string, uuid, required

## Request body

- PublishRequest
  - `slug` string: Custom URL slug (Pro only)
  - `description` string: SEO description
  - `hide_badge` boolean: Hide Unmarkdown badge (Pro only)
  - `visibility` 'link' | 'public': Access level (public is Pro only)
  - `page_width` 'standard' | 'wide' | 'full'

## Response `200`

Document 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
- `404`: Resource not found
- `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)
