torqee Developers
Guides

Realtime Events

Subscribe to workspace events with Server-Sent Events.

Realtime events are delivered from:

GET https://connect.torqee.app/api/v1/events/stream

The response is text/event-stream. Each event has event: <type> and JSON data matching the WorkspaceEvent schema in the OpenAPI spec.

Event types

Event typeRequired scope
session.createdtorqee:sessions:read
session.status_changedtorqee:sessions:read
transcript.segment.createdtorqee:transcripts:read

When filters is omitted, Connect subscribes to lifecycle events (session.created and session.status_changed) and filters them by the scopes the credential already has.

Filters

The filters query parameter is a URL-encoded JSON array. Entries are OR-matched. Each entry has a type, and transcript.segment.created also requires sessionId.

[
  { "type": "session.created" },
  { "type": "session.status_changed" },
  { "type": "transcript.segment.created", "sessionId": "session_123" }
]
curl -N "https://connect.torqee.app/api/v1/events/stream?filters=%5B%7B%22type%22%3A%22session.created%22%7D%5D" \
  -H "Authorization: Bearer torqee_YOUR_API_KEY"

Browser EventSource cannot set an Authorization header directly. Use an SSE client that supports headers, or stream the response with fetch:

const response = await fetch(
  "https://connect.torqee.app/api/v1/events/stream",
  {
    headers: { Authorization: "Bearer torqee_YOUR_API_KEY" },
  },
);
 
const reader = response.body?.getReader();

Cost and limits

Filters are limited to 20 entries. Each entry costs 10, and the current budget is 100. Requests above the budget return:

{
  "error": "filter_cost_exceeded",
  "cost": 110,
  "budget": 100,
  "entries": [
    { "type": "session.created", "cost": 10 },
    { "type": "session.status_changed", "cost": 10 }
  ]
}

Too many concurrent streams for the same workspace return:

{ "error": "connection_limit" }

Event delivery is best-effort. Events emitted while the client is disconnected are not replayed. Reconnect with backoff and reconcile missed state through the REST API.

Payload example

{
  "type": "session.created",
  "sessionId": "session_123",
  "occurredAt": "2026-07-06T00:00:00.000Z",
  "data": {
    "sessionId": "session_123",
    "occurredAt": "2026-07-06T00:00:00.000Z",
    "session": {
      "id": "session_123",
      "label": "Discovery call",
      "memo": null,
      "status": "recording",
      "startedAt": "2026-07-06T00:00:00.000Z",
      "endedAt": null,
      "createdAt": "2026-07-06T00:00:00.000Z",
      "updatedAt": "2026-07-06T00:00:00.000Z"
    }
  }
}

On this page