Skip to main content
POST /v1/sessions/{session_id}/cancel Cancels an in-progress session. Cancel only actually interrupts the Agent when the current turn is processing: the turn moves toward cancellation and then returns to idle once the turn aborts. The Session remains reusable; send the next user.message after it becomes idle. Calling cancel on an already idle Session is a no-op and returns HTTP 200.

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_019e3bb1e8c171fd9abbb1477ffb84cc/cancel \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 202 Accepted The cancel instruction executes asynchronously and returns a compact status confirmation object. HTTP 202 means cancellation was applied to a processing turn. HTTP 200 means the call was a no-op, usually because there was no processing turn. The response body shape is the same in both cases.
{
  "id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "type": "session",
  "status": "canceling"
}

Response fields

FieldTypeDescription
idstringSession ID
typestringAlways "session"
statusstringCompact cancellation confirmation value. The latest code returns "canceling" in this response body.
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.

Start a session

Run an agent against an environment as a stateful conversation.