Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/sessions/{session_id}/cancel
Cancels an in-progress session. If the session is currently processing, agent execution is interrupted and the status transitions to canceling. If the session is already idle, the operation still succeeds.
Path parameters
| Parameter | Type | Description |
|---|
session_id | string | Session ID with the sess_ prefix |
| Header | Required | Description |
|---|
Authorization | Yes | Bearer $QODER_PAT |
Content-Type | Yes | application/json |
Example request
curl -X POST https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e3bb1e8c171fd9abbb1477ffb84cc/cancel \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json"
Example response
HTTP 200 OK
Returns a compact status confirmation object.
{
"id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
"type": "session",
"status": "canceling"
}
Response fields
| Field | Type | Description |
|---|
id | string | Session ID |
type | string | Always "session" |
status | string | Status after cancellation, value is "canceling" |
canceling is a transitional state, indicating the cancel command has been issued. The terminal state will be idle or cancelled. Subscribe to the SSE stream and listen for the session.status_idle event to confirm.
Errors
| HTTP | Type | Trigger |
|---|
| 401 | authentication_error | PAT invalid or expired |
| 404 | not_found_error | Session does not exist |
See Errors for the full error envelope.