Skip to content

Transition Document

Transition the current draft through an allowed workflow transition. A transition that resolves the workflow publishes the document (published in the default workflow). Requires authentication, the DOCUMENTS feature flag, and ADMIN, UPDATE_DOCUMENT, TRANSITION_DOCUMENT, or MANAGE_DOCUMENTS permissions.

Parameters

name * are required parametersdata typedescription
documentId*stringThe unique identifier of the document.
body.state*stringThe destination workflow state ID. It must be reachable from the current draft state.
body.updatedAtnumber or nullLast known draft update timestamp in milliseconds. If provided, it must match the current draft; omission or null uses the current timestamp.
body.requiredAcknowledgmentboolean or nullWhen true, require acknowledgment of the version being published. Only allowed on publication when the document already has a numeric acknowledgment version.
body.latestChangesstringSerialized editor JSON describing the version changes. Only allowed on publication; it is saved with the published version and in the changelog.

The document must have an edited draft (draftVersion differs from version). Missing, removed, or externally managed drafts, stale timestamps, invalid transitions, and invalid publication options are rejected with HTTP 400. Replace the example timestamp with the current draft timestamp, or omit it. Publication updates the root document, saves a version snapshot, and resets the draft workflow state.

Return Value

HTTP 201 Created. The JSON body is:

json
{
  "message": "Successfully transitioned the document",
  "data": null
}

Examples

bash
curl -X POST "https://app.wombat.software/api/{targetPath}/document/:documentId/transition" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ..." \
  -d '{"state": "published", "updatedAt": 1789380000000}'

ENDPOINTS

post/api/{targetPath}/document/:documentId/transition