v5

latestOpenAPI 3.1.02026-08-025631,1012.8 MB
Agent Sessions

Respond 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

  1. User sends message via POST /sessions/{id}/messages
  2. Agent proposes a write operation
  3. Stream emits confirmation_required event with confirmation_id
  4. User calls this endpoint with approved: true/false
  5. This endpoint returns SSE stream continuing the agent's work
  6. If approved, agent executes the tool and continues
  7. 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: {}
```
post/v1/agents/sessions/{session_id}/confirmations/{confirmation_id}

Path parameters

session_idstring required

Session ID

Session ID

confirmation_idstring required

Confirmation ID

Confirmation ID

Request body

approvedboolean required

True to approve, False to deny the action

Response

Successful Response

{"stackTrail":"paths:/v1/agents/sessions/{session_id}/confirmations/{confirmation_id}:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}