---
title: "Publish draft"
method: POST
path: "/api/v2/documents/{identifier}/draft/publish"
tags: ["Documents"]
---

# Publish draft

`POST /api/v2/documents/{identifier}/draft/publish`

Publish the document's current main (non-branch) draft, promoting it to the published version. No request body — the draft is consumed, so the response echoes the now-published document metadata.

Only the main draft is publishable here; a branch-attached draft is published by merging its branch (`POST /api/v1/models/{modelId}/branch/{branchName}/merge`), so a document with no main draft returns 404. Documents that require a pull request to publish return 400.

## Path parameters

- `identifier` string, required — Document identifier — either the URL slug (e.g. `abc123`) or the canonical workbook UUID.

## Response `200`

Draft published successfully.

- DocumentsV2PublishDraftResponse
  - `description` string, nullable, required — Document description.
  - `identifier` string, required — Published document identifier.
  - `name` string, required — Document name.

## Other responses

- `400` — The document requires a pull request to publish (response detail: "Can't publish because this document can only be edited through a branch").
- `401` — Authentication required.
- `403` — Insufficient permissions to publish the draft.
- `404` — Document not found, or it has no main draft to publish (a branch-attached draft is published by merging its branch).
- `405` — Method not allowed.
- `409` — The target is not a published document.

---

[API](https://skmtc.net/omniapp/apis/omni-api.md) · [All operations](https://skmtc.net/omniapp/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omniapp/omni-api/versions/4701f292c621/schema)
