Live Conversation WebSocket (Preview)
The Live Conversation WebSocket provides real-time updates about an active conversation’s state. It is a server-to-client only connection — the client does not send any messages after connecting.
Endpoint
Authentication
This endpoint supports the same authentication methods as the STS WebSocket:
- API Key:
Authorization: Bearer PHONIC_API_KEYheader - Session Token:
?session_token=ph_session_...query parameter
Connection flow
- Connect to the WebSocket with valid credentials
- Receive an initial
conversation-updatedmessage with the current conversation state - Continue receiving
conversation-updatedmessages as the conversation progresses - Receive a
conversation-endedmessage when the conversation finishes
Server-to-client messages
conversation-updated
Sent whenever the conversation state changes. Contains the full conversation object.
The conversation object has the same shape as the Conversation returned by the REST API, with is_live always set to true.
conversation-ended
Sent when the conversation has ended. The client should close the WebSocket after receiving this.
error
Sent on authentication failure, authorization failure, or other errors. The error may appear in error.message or the top-level message field.