Deprecation notice: The websocket endpoint described on this page will be deprecated on June 15, 2026. After this date, the endpoint will no longer be available. If you are using the widget embed, you are not affected by this change — widgets will continue to work as expected. This only affects integrations that connect directly to the websocket endpoint.
To integrate your agent into your website or mobile app, use this endpoint. You can send and receive audio in real time, which allows for seamless and natural conversations.
This integration has four parts:
In your Synthflow dashboard, create an agent of the type widget. For more details on how to do that, see Create an agent.
Make a GET request to the following endpoint:
It will return a response of the form:
You can then use this session URL to connect to the websocket.
At a high level, the websocket contract works like this:
You can send two types of messages through the websocket:
{ "type": "status_client_ready" }) to signal that you are ready for the agent to start speaking.You will receive two types of messages:
{ "type": "status_agent_ready" }) that signal that the agent is ready to start receiving audio.To use the websocket connection in a webpage, follow these steps:
The sample implementation is split into three responsibilities: