Skip to main content
POST /api/v1/forward/sessions/{session_id}/cancel Requests cancellation of the current turn. If no turn is running, the endpoint returns success without starting a cancellation.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
Idempotency-KeyNoOptional idempotency key for unsafe requests.

Path parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID.

Example request

curl -s -X POST 'https://api.qoder.com/api/v1/forward/sessions/sess_xxx/cancel' \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 202 Accepted
{
  "id": "sess_xxx",
  "type": "session",
  "status": "canceling"
}

Response fields

FieldTypeDescription
idstringSession ID.
typestringAlways session.
statusstringcanceling when cancellation is accepted.

Errors

HTTPTypeCodeTrigger
401authentication_errorauthentication_requiredPAT invalid or expired.
404not_found_errorsession_not_foundSession does not exist.
409conflict_errorsession_archivedSession is archived.
502api_errorruntime_unavailableRuntime session service is unavailable.

Notes

  • 202 Accepted means a cancellation was requested.
  • 200 OK means there was no currently running turn to cancel.
  • Confirm completion through Event Stream or by polling Session status.

Stream session events

Send session events