Skip to main content

Endpoint

POST http://localhost:8080/api/v1/approvals/decision

Description

Submits an approval or rejection for a workflow that paused for human approval. On success, the decision is signaled to the workflow and execution proceeds (or terminates).

Authentication

Required: Yes Include API key in header:
X-API-Key: sk_test_123456

Request

Headers

HeaderRequiredDescription
X-API-KeyYesAPI authentication key
Content-TypeYesapplication/json
traceparentNoW3C trace context

Body Parameters

ParameterTypeRequiredDescription
workflow_idstringYesTarget workflow ID
approval_idstringYesApproval identifier
approvedbooleanYesApprove or reject
feedbackstringNoOptional feedback/comment
modified_actionstringNoOptional modified action
run_idstringNoSpecific run ID (optional)
approved_bystringNoDefaults to authenticated user

Request Body Schema

{
  "workflow_id": "task-123",
  "approval_id": "appr-456",
  "approved": true,
  "feedback": "Looks good",
  "modified_action": "",
  "run_id": ""
}

Response

200 OK

{
  "status": "sent",
  "success": true,
  "message": "Approval appr-456 processed successfully",
  "workflow_id": "task-123",
  "run_id": "",
  "approval_id": "appr-456"
}

400 / 401 / 403 / 404

{ "error": "..." }

Examples

Approve (curl)

curl -X POST "http://localhost:8080/api/v1/approvals/decision" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "task-123",
    "approval_id": "appr-456",
    "approved": true,
    "feedback": "Proceed"
  }'

Reject (Python / httpx)

import httpx

httpx.post(
  "http://localhost:8080/api/v1/approvals/decision",
  headers={"X-API-Key": api_key, "Content-Type": "application/json"},
  json={"workflow_id": wid, "approval_id": appr, "approved": False, "feedback": "Not safe"}
)

Notes

  • Replaces the legacy admin endpoint at http://localhost:8081/approvals/decision (deprecated).