Skip to main content

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. Cancel only actually interrupts the Agent when the Session is processing: the status moves to canceling, then back to idle once the turn aborts, and the Session remains reusable — just send the next user.message, no need to create a new Session. Calling cancel on an already-idle Session is a no-op: the call still returns 200 and the status stays idle.

Path parameters

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT
Content-TypeYesapplication/json

Example request

curl -X POST https://api.qoder.com/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

FieldTypeDescription
idstringSession ID
typestringAlways "session"
statusstringStatus after cancellation, value is "canceling"
canceling is a transitional state, indicating the cancel command has been issued. After the turn aborts, the status settles back to idle. Subscribe to the SSE stream and listen for the session.status_idle event to confirm.

Errors

HTTPTypeTrigger
401authentication_errorPAT invalid or expired
404not_found_errorSession does not exist
See Errors for the full error envelope.