Voice WebSocket Protocol
Stream real-time voice call events over a persistent WebSocket connection. Use this protocol for live dashboards, call monitoring, real-time transcription displays, and custom call control interfaces.Connection Setup
Endpoint
Authentication
Include your API key as a query parameter or in the first message after connection:auth message after connecting:
auth.success or auth.error message:
SDK Connection
The SDKs handle connection, authentication, and reconnection automatically.Message Format
All messages follow a consistent envelope format:Message Types
call.started
Emitted when an outbound or inbound call is connected.call.ringing
Emitted when the outbound call is ringing on the recipient’s end.call.answered
Emitted when the recipient picks up.call.transcription
Emitted in real-time as speech is transcribed. Segments may be partial (streaming) or final.call.agent_response
Emitted when the agent generates a response that will be spoken.call.dtmf
Emitted when the caller presses a key on their phone keypad (DTMF tone).call.hold
Emitted when the call is placed on or taken off hold.call.transfer
Emitted when the call is transferred to another number or agent.call.sentiment
Emitted periodically with rolling sentiment analysis.call.ended
Emitted when the call terminates for any reason.call.error
Emitted when an error occurs during the call.Subscribing to Specific Calls
Filter events to a specific call or agent by sending asubscribe message:
Heartbeat / Ping-Pong
The server sends aping message every 30 seconds. The client must respond with a pong within 10 seconds or the connection will be closed.
ping.
Error Handling
Connection Errors
Reconnection Strategy
Use exponential backoff with jitter for automatic reconnection:- First retry: 1 second
- Second retry: 2 seconds
- Third retry: 4 seconds
- Max backoff: 30 seconds
- Add random jitter of 0-1 seconds to each delay
Next Steps
- Quickstart: Voice Calls — Make your first AI-powered phone call
- Voice Catalog — Browse available voice models
- Call Intelligence — Recording, transcription, and scoring
- Webhooks — HTTP-based event delivery as an alternative to WebSocket
