Skip to content

POST /v1/sessions/{session_id}/cancel - Cancel current turn

POST
/v1/sessions/{session_id}/cancel

Cancels the currently running turn in the session. If no turn is running, this is a no-op and returns success (idempotent). When a turn is active:

  1. Cancel the underlying workflow execution
  2. Emit a turn.cancelled event
  3. Insert an agent message indicating the turn was cancelled
  4. Set the session status back to idle
session_id
required
string

Session ID (prefixed, e.g., session_…)

Turn cancelled successfully (or no-op if idle)

Response from cancel turn endpoint

object
message
required

Human-readable message

string
Example
Turn cancelled successfully
status
required

Whether the cancellation was performed or was a no-op

string
Allowed values: cancelled no_op

Invalid session ID

Session not found

Internal server error