Skip to Content

Approval Endpoints

Human-in-the-loop (HITL) approval management. The approval-service runs on port 8004 and is proxied through the API gateway at http://localhost:8000.

Endpoints

MethodPathDescription
POST/approvalsCreate an approval request
GET/approvalsList approval requests
GET/approvals/{id}Get approval details
POST/approvals/{id}/decideApprove or reject
POST/approvals/escalateEscalate a pending approval

POST /approvals

Create a new approval request. Typically called by the orchestration engine when an agent reaches an HITL checkpoint.

curl -X POST http://localhost:8000/approvals \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "conversation_id": "conv-abc123", "agent_type": "rule_37", "checkpoint_type": "pre_filing", "payload": { "filing_type": "W-1", "entity_id": "well-001", "summary": "Rule 37 spacing exception for Smith Ranch #1" }, "reviewer_strategy": "named_individual", "reviewer_id": "user-engineer-01" }'

Response (201):

{ "approval_id": "apr-xyz789", "status": "pending", "checkpoint_type": "pre_filing", "created_at": "2026-04-10T15:00:00Z", "reviewer_id": "user-engineer-01" }

GET /approvals

List approval requests with optional filters.

curl -H "Authorization: Bearer $TOKEN" \ "http://localhost:8000/approvals?status=pending&agent_type=rule_37"
ParameterTypeDescription
statusstringFilter: pending, approved, rejected, modified
agent_typestringFilter by agent type
limitintPage size (default 20)
offsetintPagination offset

Response (200):

{ "approvals": [ { "approval_id": "apr-xyz789", "status": "pending", "checkpoint_type": "pre_filing", "agent_type": "rule_37", "created_at": "2026-04-10T15:00:00Z" } ], "total": 5 }

POST /approvals/{approval_id}/decide

Approve, reject, or request modifications.

curl -X POST http://localhost:8000/approvals/apr-xyz789/decide \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "decision": "approved", "reviewer_id": "user-engineer-01", "comments": "Filing package looks complete. Approved for submission." }'
FieldTypeRequiredDescription
decisionstringYesapproved, rejected, or modified
reviewer_idstringYesID of the reviewing user
commentsstringNoReview comments
modificationsobjectNoRequested changes (when decision is modified)

All decisions are recorded in the immutable audit trail. They cannot be modified or deleted after submission.


POST /approvals/escalate

Escalate a pending approval that has not been acted on.

curl -X POST http://localhost:8000/approvals/escalate \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "approval_id": "apr-xyz789", "reason": "Original reviewer unavailable, deadline in 24 hours" }'
Last updated on