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_required event with confirmation_idapproved: true/falseConfirmations 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:
# 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: {}
REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.
"Bearer YOUR_API_KEY"
"Bearer YOUR_STRIPE_API_KEY"
REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'
"ns_abc123def456"
"production"
"my-namespace"
Request to approve or deny a pending confirmation.
True to approve, False to deny the action
Successful Response