Approve Tool Call
Task API
Approve Tool Call
Approve or reject a pending tool call
POST
Approve Tool Call
Approve Tool Call
When a task is created withautoExecute=false, tool calls require manual approval before they execute. Use this endpoint to approve or reject pending tool calls.
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique task identifier |
callId | string | The tool call identifier (from the tool_call event) |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
outcome | string | Yes | The approval decision |
Outcome Values
| Value | Description |
|---|---|
proceed_once | Execute this specific tool call only |
proceed_always | Execute and auto-approve similar calls for this session |
cancel | Reject the tool call |
Response
| Field | Type | Description |
|---|---|---|
approved | boolean | true if approved, false if cancelled |
Workflow
1. Create Task with Manual Approval
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: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_resultevent with the execution result- Continued
contentevents 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
| Code | Description |
|---|---|
AUTH_REQUIRED | No authentication provided |
INVALID_API_KEY | Invalid or expired API key |
NOT_FOUND | Task or tool call not found |
VALIDATION_ERROR | Invalid outcome value |