API Reference

Approvals API

Human-in-the-loop approval workflows — list, approve, and deny pending agent actions.

When the Gate API returns a require_approval decision, the agent is paused and an approval request is created. The Approvals API lets your team review the pending action, inspect its parameters, and approve or deny it. Once a decision is made, the agent resumes or aborts accordingly.

GET /api/approvals

GET /api/approvals

List approval requests. Defaults to returning only pending items. Use the ?status= query parameter to filter by status: pending, approved, denied, expired. Supports ?agent_id=, ?page=, and ?limit=.

Response

{
  "approvals": [
    {
      "approval_id": "apr_abc123",
      "agent_id": "customer-support-bot",
      "action": "send_customer_email",
      "parameters": {
        "to": "customer@example.com",
        "subject": "Your refund"
      },
      "risk_level": "MEDIUM",
      "status": "pending",
      "requested_at": "2026-04-06T14:23:11Z",
      "expires_at": "2026-04-06T14:28:11Z"
    }
  ],
  "total": 3,
  "page": 1
}
FieldTypeDescription
approval_idstringUnique identifier for this approval request
actionstringThe tool or action awaiting approval
parametersobjectTool call parameters for review
risk_levelstringLOW, MEDIUM, HIGH, CRITICAL
expires_atstring (ISO 8601)If no decision is made by this time, the action is blocked

GET /api/approvals/{approval_id}

GET /api/approvals/{approval_id}

Retrieve a specific approval request by its ID. The agent runtime polls this endpoint after receiving a require_approval gate decision, waiting for status to transition from pending to approved or denied.

Response schema is the same as a single item in the GET /api/approvals list, plus approved_by, approved_at, and note fields once a decision has been made.

POST /api/approvals/{approval_id}/approve

POST /api/approvals/{approval_id}/approve

Approve the pending action. The agent resumes execution immediately after a successful approval. The decision, approver identity, and optional note are persisted in the audit log.

Request body

{
  "approver": "admin@company.com",
  "note": "Verified — correct customer, correct refund amount"
}

Response

{
  "approval_id": "apr_abc123",
  "status": "approved",
  "approved_by": "admin@company.com",
  "approved_at": "2026-04-06T14:24:33Z",
  "action_executed_at": "2026-04-06T14:24:34Z"
}
FieldTypeDescription
approverstringIdentity of the person approving (email or user ID)
notestringOptional justification, stored in the audit log
action_executed_atstringTimestamp when the agent's tool call was executed post-approval

POST /api/approvals/{approval_id}/deny

POST /api/approvals/{approval_id}/deny

Deny the pending action. The agent receives a block response and the tool call is not executed. The reason field is surfaced to the agent so it can communicate the outcome to the end user.

Request body

{
  "approver": "admin@company.com",
  "reason": "Wrong recipient address"
}
FieldTypeDescription
approverstringIdentity of the person denying
reasonstringRequired. Reason for denial, stored in audit log and returned to the agent.

GET /api/approvals/audit

GET /api/approvals/audit

Full audit log of all approval decisions across all agents. Returns both approved and denied decisions with full context. Useful for compliance reporting and security reviews.

Query parameters

ParameterTypeDescription
agent_idstringFilter by agent
statusstringFilter by status: approved, denied, expired
fromISO 8601Start of time range (inclusive)
toISO 8601End of time range (inclusive)
pageintegerPage number (default: 1)
limitintegerResults per page (default: 50, max: 500)
Timeout behavior: Approvals expire after the configured timeout. If no decision is made before expires_at, the action is blocked by default. You can change this behavior with on_timeout: allow in your gate policy — but this is not recommended for production environments where high-risk actions require explicit sign-off.