Publish a document

Publish the document's current draft, making it the version used for new renders. The previously published version is kept unchanged, and renders that already used it are unaffected. After publishing the document has no draft until it is edited again.

The draft must contain at least one section, and every section must be renderable (for example, a PDF section needs an uploaded file); otherwise the request returns 400 with the reasons.

Pass expected_draft_version_id (the draft_version_id you reviewed) to guard against publishing changes someone else saved in the meantime: if the document's draft has moved on, the request returns 409 and nothing is published. If someone else already published that draft, the document has no draft and the request returns 400.

Documents are shared by your sandbox and production environments, so changing one with an API key requires a production API key. A sandbox API key can read documents but gets 403 here.

Documents are opt-in per organization: unless the org_documents feature flag is enabled for your organization this endpoint returns 404.

Path Params
string
required

Must be a UUID. The unique identifier of the document.

Body Params
uuid

Optional. The draft version you intend to publish. If the document's current draft is a different version, the request fails with 409.

Responses

400

The document has no draft, or the draft is not publishable (no sections, or a section that cannot be rendered).

403

The request used a sandbox API key, or the caller is missing the communications:create permission.

404

No such document, or documents are not enabled for the organization.

409

expected_draft_version_id no longer matches the document's draft.

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json