POST /v1/sessions/{session_id}/cancel - Cancel current turn
POST /v1/sessions/{session_id}/cancel
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:
- Cancel the underlying workflow execution
- Emit a turn.cancelled event
- Insert an agent message indicating the turn was cancelled
- Set the session status back to idle
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” session_id
required
string
Session ID (prefixed, e.g., session_…)
Responses
Section titled “ Responses ”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
Invalid session ID
Session not found
Internal server error