Skip to navigation

Stream realtime call events (WebSocket)

Opens a WebSocket that streams live call events for the account. Send a standard WebSocket upgrade request (Connection: Upgrade, Upgrade: websocket) with your API key in the Authorization header; the server answers 101 Switching Protocols. OpenAPI cannot describe the messages exchanged after the upgrade, so they are listed here.

Client → server (JSON text frames, type field):

  • {"type":"subscribe","call_id":"<uuid>","replay":true} follows one call; replay first sends the call’s earlier events. Omit call_id to follow every call in the account.
  • {"type":"unsubscribe","call_id":"<uuid>"} stops following a call (or the account-wide stream when call_id is omitted).
  • {"type":"ping"}: the server answers pong.

Server → client: every frame is an envelope {"v":1,"type":"<event>","call_id":"<uuid>","seq":42,"ts":1767225600000,"data":{...}}. seq increases by one per frame on a connection, so a gap means frames were dropped. Per-call event types: status, error, transcript, interim, tts, tts_word, speech, turn, node_transition, recording, voicemail. Account-wide event types: call.created, call.status, call.ended. Under backpressure only interim, tts and tts_word frames may be dropped. Events of one call can arrive out of order across types; do not rely on cross-type ordering.

The server pings every 25 seconds and closes an idle connection after 5 minutes without any inbound frame.

Authentication

AuthorizationBearer

Pass a JWT access token or an API key (prefixed with tif_live_) as a Bearer token.

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error