Developer resources

Approval Workflows

Govern content progression with multi-step review and sign-off.

How it works

  1. One state machine per deliverable

    A workflow starts in in_review and ends in approved, rejected or changes_requested. Steps are sequential: each role must approve before the next step activates.

  2. Role hierarchy

    Reviewer → Editor → Approver → Publisher. You choose which roles participate and in which order the chain runs.

  3. Humans decide

    API keys can create workflows and read status, but only an authenticated human user can submit a decision. Agents cannot self-approve.

  4. Immutable audit trail

    Every decision appends an entry with the step, role, decision, comments, user and timestamp. Entries are never edited or removed.

Create a workflow

bash
curl -X POST https://lucidry.base44.app/functions/approvals \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"job_id": "job_123", "content_artifact_id": "td_456", "approver_roles": ["reviewer", "editor", "approver"]}'

Response

json
{
  "workflow_id": "wf_100",
  "status": "in_review",
  "current_step": 1,
  "total_steps": 3,
  "steps": [
    { "step_number": 1, "approver_role": "reviewer", "status": "pending" },
    { "step_number": 2, "approver_role": "editor", "status": "pending" },
    { "step_number": 3, "approver_role": "approver", "status": "pending" }
  ]
}

Submit a decision

decision is approved, rejected or changes_requested. Comments are required.

bash
curl -X POST https://lucidry.base44.app/functions/approvals/wf_100/decide \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision": "approved", "comments": "Content meets brand standards."}'

Response

json
{
  "workflow_id": "wf_100",
  "status": "in_review",
  "current_step": 2,
  "decision_recorded": true,
  "qa_warning": null
}

Get workflow status

bash
curl -X GET https://lucidry.base44.app/functions/approvals/wf_100 \
  -H "Authorization: Bearer YOUR_API_KEY"

Resubmit after changes

bash
curl -X POST https://lucidry.base44.app/functions/approvals/wf_100/resubmit \
  -H "Authorization: Bearer YOUR_API_KEY"

State machine

  1. in_review

    Created, awaiting the first role's decision.

  2. approved

    Every step approved. The deliverable is cleared for publication or delivery.

  3. rejected

    Any step rejected. The workflow terminates and cannot be decided again.

  4. changes_requested

    Any step requested changes. Resubmit to re-open that same step and return to in_review.

Webhook events

Subscribe an endpoint to these events to drive your own publishing pipeline.

approval.submitted

json
{
  "workflow_id": "wf_100",
  "job_id": "job_123",
  "content_artifact_id": "td_456",
  "approver_roles": ["reviewer", "editor", "approver"],
  "timestamp": "2026-08-31T15:00:00.000Z"
}

approval.approved

json
{
  "workflow_id": "wf_100",
  "step_number": 1,
  "role": "reviewer",
  "comments": "Content meets brand standards.",
  "timestamp": "2026-08-31T15:05:00.000Z"
}

approval.rejected

json
{
  "workflow_id": "wf_100",
  "step_number": 2,
  "role": "editor",
  "comments": "Claims cannot be sourced.",
  "timestamp": "2026-08-31T15:10:00.000Z"
}

approval.changes_requested

json
{
  "workflow_id": "wf_100",
  "step_number": 2,
  "role": "editor",
  "comments": "Tighten the executive summary.",
  "timestamp": "2026-08-31T15:12:00.000Z"
}

Signing and retry behavior is identical to job events, see the Webhooks documentation.

Roles and permissions

Which roles can decide, view and create approval workflows
RoleCan decideCan viewCan create
Owner / AdminAny stepYesYes
MemberReviewer and Editor stepsYesYes
ViewerNoYesNo
API key / AgentNo, humans onlyYesYes

QA guard and limits

  • When the artifact's quality score is below 0.80, the step carries an automated QA warning. The human decision always stands.
  • Comments are required on every decision. An empty comment is rejected with a 422.
  • Approval endpoints allow 60 requests per minute per API key.