Skip to main content

Cancel an active turn and retain any persisted partial answer

DELETE 

/api/v2/chat-sessions/:session_id/turns/:turn_id

Returns 202 and the current session, including repeated cancellation of terminal turns. Queued or waiting attempts are cancelled immediately. A running attempt receives a durable cancellation flag and a best-effort notification to the agent; its terminal turn.updated event arrives after the worker finishes cancellation. Cancellation retains persisted partial output and does not delete history.

Request​

Responses​

Updated canonical session

Response Headers
    X-Contract-Version

    Version of the gaius-api-contracts release the backend runs (legalgpt-contracts), sent on every response. Clients compare it with the @legalgpt/contracts version they were built with; both packages share one version per contract.

    Cache-Control

    Prevents storage of sensitive authenticated chat data.

    ETag

    Strong session revision tag. Polish has no suffix; other supported languages append the language code. Use the same Accept-Language on reads and conditional mutations.

    Content-Language

    Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.