Skip to content
torqee Developers
Esc
↑↓navigate↵open⌘Jpreview

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.

GET/api/v1/events/stream
Authorization
AuthorizationOAuth2 access token · headerrequired

OAuth 2.1 authorization code flow with PKCE. Audience must be the connect URL.

or
AuthorizationBearer token · headerrequired

Workspace 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.

Query parameters
filtersstring

URL-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.

Responses
200

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.

string
400

Malformed filters, or filter cost exceeds the budget

Any of:
object
errorstringrequired
object
errorstringrequired
costnumberrequired
budgetnumberrequired
entriesobject[]required
Show properties
Array of object
One of:
object
costnumberrequired
typestringrequired
sessionIdstring
min length 1
object
costnumberrequired
typestringrequired
sessionIdstring
min length 1
statusstring[]
min items 1
object
costnumberrequired
typestringrequired
sessionIdstring
min length 1
object
costnumberrequired
typestringrequired
sessionIdstring
min length 1
401

Missing or invalid credentials

errorstringrequired
Allowed:unauthorized
403

Membership revoked or insufficient scope

errorstringrequired
Allowed:insufficient_scopeforbidden
429

Too many concurrent connections for the workspace

errorstringrequired
Allowed:connection_limit
500

Unexpected server error

errorstringrequired
Allowed:internal_server_error
Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://connect.torqee.app/api/v1/events/stream' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json'
Response
"string"

Was this page helpful?