Stream persisted canonical message and turn replacements using SSE
GET/api/v2/chat-sessions/:session_id/turns/:turn_id/events
Persisted message.updated and turn.updated replacements are replayed in ordinal order. Event IDs are opaque UUIDs, not sortable cursors. Send the last processed ID in Last-Event-ID, or use after as a query fallback. A cursor not found in this turn returns HTTP 410 before streaming; a malformed UUID returns HTTP 400. The server does not emit stream.reset.
Private document turns can also emit docx.operation notifications containing document text. The authenticated pending-operation queue, not SSE delivery, determines which operations still need to be applied.
The default heartbeat is an SSE comment every 15 seconds while idle. Polling for committed events defaults to 0.25 seconds. These intervals are configurable. After a complete, failed, or cancelled turn, the stream drains remaining persisted events and closes. The terminal turn.updated contains the authoritative full turn. Clients must clear the loading state from it and recover via session GET if disconnected. Active delivery is independent of client connection lifetime. No enforced event-retention expiry or terminal-stream TTL is currently implemented.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 410
- 500
Open SSE stream. data is one JSON object matching the schema named by
the SSE event field. Intermediaries must not buffer or transform it.
Response Headers
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.
Prevents storage and intermediary transformation of the event stream.
Deployment-specific hint used by nginx to disable response buffering.
Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.
Malformed request
Response Headers
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.
Prevents storage of sensitive authenticated chat data.
Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.
Missing or invalid API key
Response Headers
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.
Prevents storage of sensitive authenticated chat data.
Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.
Authenticated, but the API key's account has no access to this resource
Response Headers
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.
Prevents storage of sensitive authenticated chat data.
Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.
Resource does not exist or is not visible to the caller
Response Headers
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.
Prevents storage of sensitive authenticated chat data.
Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.
Last-Event-ID or after does not identify a retained event in this turn. Fetch the session and reconnect without the cursor.
Response Headers
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.
Unexpected request failure.
Response Headers
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.
Prevents storage of sensitive authenticated chat data.
Language selected for outgoing generic tool-status labels and known HTTP/timeline error text. HTTP reason-phrase titles remain language-neutral.