Skip to main content
POST
Approve Tool Call

Approve Tool Call

When a task is created with autoExecute=false, tool calls require manual approval before they execute. Use this endpoint to approve or reject pending tool calls.

Request

Path Parameters

Request Body

Outcome Values

Response

Workflow

1. Create Task with Manual Approval

Response:

2. Connect to Stream & Receive Tool Call Event

Connect to the stream endpoint to receive events. When the agent needs to use a tool, you’ll receive:
You can also poll GET /api/v1/tasks/:id to check for pendingApprovals without using SSE.

3. Approve or Reject

4. Task Continues

After approval, the tool executes and the task continues. You’ll receive:
  • tool_result event with the execution result
  • Continued content events as the agent processes the result

Full Example

Use Cases

Security Review

Review file system operations before allowing the agent to read or write files

Cost Control

Approve API calls to external services that may incur costs

Audit Trail

Log all tool executions for compliance and debugging

Sensitive Operations

Manually approve operations involving sensitive data

Errors