Skip to content

Workflow + Approvals API

Stories move through configurable workflow stages (e.g. draftin-reviewpublished). Each transition is permission-checked, optionally requires N approvals from authorized reviewers, and is recorded in an immutable audit log.

Workflow stages

http
GET    /v1/spaces/{slug}/workflow-stages
POST   /v1/spaces/{slug}/workflow-stages
PATCH  /v1/spaces/{slug}/workflow-stages/{id}
DELETE /v1/spaces/{slug}/workflow-stages/{id}

Stages are space-scoped and ordered via position. Each carries:

FieldPurpose
keymachine name (draft, review, published)
labelhuman display name
positionordering
required_approvalshow many distinct reviewers must approve before next stage
can_publishterminal stage that flips the Story's status to published
allowed_roleminimum role that may initiate this transition

Transitions

http
POST /v1/spaces/{slug}/stories/{uuid}/transitions

Body:

json
{
  "to_stage": "review",
  "message": "Headline reworked, ready for editorial."
}

Response: 200 { workflow_stage_id, history_entry_id } on success; 422 { error: "stage_not_reachable" } if the destination doesn't follow the configured graph; 403 if your role lacks the allowed_role.

Approvals

http
POST /v1/spaces/{slug}/stories/{uuid}/approvals

Reviewers post one approval each. Once required_approvals is hit, the transition completes automatically.

http
DELETE /v1/spaces/{slug}/stories/{uuid}/approvals/{approval_id}

Revoke an approval before the threshold is reached.

History (audit log)

http
GET /v1/spaces/{slug}/stories/{uuid}/workflow-history

Returns the full transition trail: who, when, from, to, message, approval count. Never deleted, never edited — RBAC ensures only the viewer+ role can read.

See also