Skip to main content
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

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT

Example request

curl -X POST https://api.qoder.com/api/v1/cloud/sessions/sess_019ef30a4f0275678965d496ab542ef0/cancel \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK (no-op) or HTTP 202 Accepted (cancellation applied)
{
  "id": "sess_019ef30a4f0275678965d496ab542ef0",
  "type": "session",
  "status": "canceling"
}
The status field is "canceling" in both cases. After the turn aborts, the Session returns to idle.

Errors

HTTPTypeTrigger
401authentication_errorPAT invalid or expired
404not_found_errorSession 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
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session 'sess_does_not_exist_0000000000000000000000000000' was not found."
  }
}
See Errors for the full error envelope.

Start a session

Run an agent against an environment as a stateful conversation.