Stream workspace events (SSE)
Opens a Server-Sent Events stream of workspace events. Event payloads follow the WorkspaceEvent schema (see #/components/schemas/WorkspaceEvent). Scopes are checked per subscribed event type: session.* requires torqee:sessions:read, transcript.* requires torqee:transcripts:read. When filters is omitted, only lifecycle events (session.created, session.status_changed) allowed by the granted scopes are delivered; no 403 is returned in that case unless the credential carries no readable scope at all. Delivery is best-effort: events emitted while disconnected are lost. Reconcile via the REST API after reconnecting. Gaps in transcript segment data’s sessionCommittedIndex reveal missed segments; reconcile committed transcripts via the REST API. Streams always terminate within a bounded time: when the access token expires, when a periodic re-authorization (every 60s) finds the credential revoked, or when an API key connection reaches the one hour maximum. Note that the token expiry is measured from when the token was issued, not from when the stream was opened. Before closing, the server emits a terminal event: stream_closed whose JSON data matches StreamClosedEvent (see #/components/schemas/StreamClosedEvent). On token_expired, refresh the access token before reconnecting; on max_connection_time, reconnect immediately; on revoked, re-authorize (or narrow your filters to the scopes you still hold) before reconnecting. A stream may also be closed without a stream_closed event when the client stops reading and its server-side buffer overflows; the dropped backlog is not replayed, so reconcile via the REST API after reconnecting.
/api/v1/events/streamAuthorizationOAuth2 access token · headerrequiredOAuth 2.1 authorization code flow with PKCE. Audience must be the connect URL.
AuthorizationBearer token · headerrequiredWorkspace API key issued from the torqee web app. Pass the torqee_-prefixed key as the bearer token. API keys carry the same read scopes as OAuth tokens.
filtersstringURL-encoded JSON array of subscription entries (max 20, OR-matched). Structure: #/components/schemas/EventStreamFilters. transcript.segment.created entries without sessionId match segments from every session in the workspace.
SSE stream. Every frame carries event: <name> and a JSON data payload. Data frames use one of the WorkspaceEvent types (#/components/schemas/WorkspaceEvent) and their data is the matching WorkspaceEvent.data. The single terminal frame uses event: stream_closed and its data matches StreamClosedEvent (#/components/schemas/StreamClosedEvent) instead — parse it separately from WorkspaceEvent. Heartbeat comments (: ping) are sent periodically.
stringMalformed filters, or filter cost exceeds the budget
errorstringrequirederrorstringrequiredcostnumberrequiredbudgetnumberrequiredentriesobject[]requiredShow propertiesHide properties
objectcostnumberrequiredtypestringrequiredsessionIdstringcostnumberrequiredtypestringrequiredsessionIdstringstatusstring[]costnumberrequiredtypestringrequiredsessionIdstringcostnumberrequiredtypestringrequiredsessionIdstringMissing or invalid credentials
errorstringrequiredunauthorizedMembership revoked or insufficient scope
errorstringrequiredinsufficient_scopeforbiddenToo many concurrent connections for the workspace
errorstringrequiredconnection_limitUnexpected server error
errorstringrequiredinternal_server_error