POST /chat/cancel
Cancel a pending action that was planned by the agent and is waiting for user confirmation. This endpoint is used when the agent returnsrequires_confirmation: true in the chat response or emits a confirmation_required event during streaming, but the user decides not to proceed.
Authentication
Requires a valid session cookie (session_id) obtained through the OAuth flow.
Request Body
Thread ID of the conversation to cancel. This is the same thread ID returned by the agent when it requested confirmation.
Request Example
Response
Thread ID of the conversation
Cancellation status -
"cancelled" when the action is successfully cancelledConfirmation message - always
"Action cancelled."Whether the cancellation was successful - always
trueResponse Example
Workflow Example
1. Agent requests confirmation
When using synchronous chat:2. User cancels
3. Action is cancelled
The agent cancels the planned actions and confirms the cancellation.Status Codes
| Code | Description |
|---|---|
| 200 | Action cancelled successfully |
| 401 | Not authenticated - missing or invalid session cookie |
| 429 | Rate limit exceeded |
| 500 | Failed to cancel action |
Error Response
Rate Limiting
Default rate limit: 60 requests per minute per session.cURL Example
JavaScript Example
After cancelling an action, you can continue the conversation by sending a new message with the same thread_id. The conversation state is preserved, and you can ask the agent to perform different actions or provide more information.
If you want to proceed with the action instead of cancelling it, use the confirm endpoint.