torqee Developers
Api reference/Events

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. 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
AuthorizationBearer <token>

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

In: header

Query Parameters

filters?string

URL-encoded JSON array of subscription entries (max 20, OR-matched). Structure: #/components/schemas/EventStreamFilters. transcript.segment.created entries require sessionId.

Response Body

curl -X GET "https://connect.torqee.app/api/v1/events/stream?filters=string"
fetch("https://connect.torqee.app/api/v1/events/stream?filters=string")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://connect.torqee.app/api/v1/events/stream?filters=string"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://connect.torqee.app/api/v1/events/stream?filters=string"

response = requests.request("GET", url)

print(response.text)
"string"
{
  "error": "invalid_filters"
}
{
  "error": "unauthorized"
}
{
  "error": "insufficient_scope"
}
{
  "error": "connection_limit"
}
{
  "error": "internal_server_error"
}