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.
400The document has no draft, or the draft is not publishable (no sections, or a section that cannot be rendered).
403The request used a sandbox API key, or the caller is missing the communications:create permission.
404No such document, or documents are not enabled for the organization.
409expected_draft_version_id no longer matches the document's draft.