WebSocket endpoint for web calls
WebSocket endpoint for web calls
Establishes a WebSocket connection for real-time web-based calls. This is not a traditional HTTP endpoint - it upgrades to WebSocket protocol.
GET
WebSocket endpoint for web calls
Connection Types
Chat (chat):
- Text-based conversations without voice
- No WebRTC required
- Lower bandwidth usage
- Use cases: customer support chat, FAQ bots
webCall):
- Browser-based voice calls using WebRTC
- Real-time audio streaming
- Requires HTTPS and microphone access
- Use cases: voice customer support, interactive demos
onPhone):
- Traditional phone calls via SIP
- External phone number required
- Works with landlines/mobile devices
- Use cases: outbound campaigns, call centers
Message Format
All messages use JSON structure:Client → Server Messages
- initialize: Start new conversation with call type
- incomingChatMessage: Send text message
- sdpAnswer: Respond to WebRTC SDP offer
- websocketToolResponse: Return tool execution result
- terminate: End conversation
Server → Client Messages
- event: System events (connection, opened, closed)
- text: Text messages from agent or user
- sdpInvite: WebRTC SDP offer for voice calls
- toolCall: Agent requesting tool execution
- conversationResult: Final conversation summary
- error: Error messages
Connection Flow
- Establish connection to WebSocket endpoint
- Send initialize message with call type and configuration
- Receive connection event when agent is ready
- Exchange messages bidirectionally
- Send terminate to end session gracefully