Cancel Turn Stream
Cancel (or steer) the chat's currently-running turn (TOS-2269).
A deliberate Stop or steer is distinguishable from an ambient disconnect only because the frontend calls this endpoint before aborting the fetch. The endpoint writes cancel_requested = true (plus redirect_text when present) onto every live chat_stream_progress row for this chat (kept for _should_detach_stream_on_cancel's end-of-stream check, and as the {"canceled": bool} liveness signal below) AND, as of TOS-3574, onto chat_turn_state stamped with the chat's CURRENT turn generation. The running turn's TurnCancelWatcher only honors the latter: it polls for a signal matching the exact generation it was started with, so a signal that arrives after this turn has already ended (and a new one has begun) can never be mistaken for a cancel aimed at the new turn - the race TOS-3568 narrowed but could not fully close on chat_stream_progress alone, because that row's identity depends on which agent ends up responding, not known until routing completes.
Returns {"canceled": bool} - True if a live turn was found and flagged, False if nothing was running (idempotent: a double-click on Stop, or a steer after the turn already finished, is a safe no-op).
Request
- Base URL: https://app.thinqos.com (the document declares no server; this is the origin it was published from)
- URL: https://app.thinqos.com/api/chats/{chat_id}/turn-stream/cancel
- Auth: none declared
Path parameters
Headers
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.