POST /api/v1/cloud/sessions/{session_id}/cancel
Requests cancellation of the current turn in a Session. Cancel on a running Session returns HTTP 202 Accepted and the Session transitions through canceling back to idle. Cancel on an idle Session is a safe no-op and returns HTTP 200 OK.
Path parameters
| Parameter | Type | Description |
|---|---|---|
session_id | string | Session ID with the sess_ prefix |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $QODER_PAT |
Example request
Example response
HTTP 200 OK (no-op) or HTTP 202 Accepted (cancellation applied)status field is "canceling" in both cases. After the turn aborts, the Session returns to idle.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 401 | authentication_error | PAT invalid or expired |
| 404 | not_found_error | Session does not exist or has been archived |
Note: Calling cancel on an already-idle Session is a safe no-op and returns HTTP 200. The response always uses the same lightweight format regardless of whether cancellation was applied (202) or was a no-op (200).HTTP 404 Not Found
Related
Start a session
Run an agent against an environment as a stateful conversation.