v5
latestOpenAPI 3.1.02026-08-025631,1012.8 MBRespond To Confirmation
Respond to a pending confirmation for a write operation.
When the agent requests a write operation (create, update, delete), the stream pauses and emits a confirmation_required event. The user must call this endpoint to approve or deny the action.
After responding, this endpoint returns a new SSE stream that continues the agent's execution from where it paused.
Confirmation Workflow
- User sends message via POST /sessions/{id}/messages
- Agent proposes a write operation
- Stream emits confirmation_required event with confirmation_id
- User calls this endpoint with approved: true/false
- This endpoint returns SSE stream continuing the agent's work
- If approved, agent executes the tool and continues
- If denied, agent acknowledges and continues without executing
Confirmation Expiration
Confirmations expire after 5 minutes. Attempting to respond to an expired confirmation returns a 400 error.
Args: request: FastAPI request with tenant context session_id: Session identifier confirmation_id: Confirmation identifier from confirmation_required event payload: Approval/denial decision
Returns: StreamingResponse with SSE events (continuation of agent execution)
Raises: NotFoundError: If session or confirmation not found ValidationError: If confirmation already processed or expired
Example:
```bash
# Approve a pending action
curl -N -X POST http://localhost:8000/v1/agents/sessions/ses_abc/confirmations/conf_xyz
-H "Authorization: Bearer {api_key}"
-H "X-Namespace: {namespace_id}"
-H "Content-Type: application/json"
-d '{"approved": true}'
# SSE Output (continuation):
event: tool_result
data: {"tool_name": "delete_collection", "success": true, "result": {...}}
event: token
data: {"content": "I've deleted the collection as requested."}
event: done
data: {}
```
Path parameters
Session ID
Session ID
Confirmation ID
Confirmation ID
Request body
Response
Successful Response