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

# Publish draft

`POST /v2/documents/{documentId}/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's metadata.

Only the main draft is publishable with this endpoint. A branch-attached draft is published by [merging its branch](/api/model-branches/merge-a-branch).

## Path parameters

- `documentId` string, required

## Response `200`

Draft published successfully.

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

## Other responses

- `400` — The document requires a pull request to publish (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 - Invalid HTTP method for this endpoint
- `409` — The target is not a published document.

---

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