Voice API
Use the Voice API to connect incoming phone calls to your application. For each call, your application selects an interaction mode: Text-to-voice or Voice-to-voice. This determines whether your application exchanges text or audio with Seamly.
Seamly sends the same authenticated HTTP request to your application’s endpoint to set up the conversation for both interaction modes. Your application responds with the interaction mode, the conversation settings required for that mode, and a secure WebSocket URL. Seamly then opens the WebSocket connection for the duration of the call.
Requirements
Your application must provide:
-
An HTTPS endpoint that accepts a
POSTrequest. -
Validation of Seamly's
X-Seamly-Signaturerequest header. see HMAC signature for more information. -
A secure WebSocket (
wss://) endpoint for each conversation. - A message handler that implements the WebSocket event sequences described in this guide.
- Logic that sends the first conversational message after acknowledging the WebSocket connection (when using interaction mode Text-to-voice
interaction modes
Text-to-voice
Use Text-to-voice when your application controls the conversation using text messages. Your application receives transcribed caller messages and sends text responses. Seamly handles the phone connection, STT, TTS, barge-in, and call lifecycle.
Voice-to-voice
Use Voice-to-voice when your application has its own voice-processing capabilities. Your application receives the caller’s audio and sends audio responses directly to Seamly. Your application handles voice processing and conversation logic, while Seamly handles the phone connection.
Integration flow overview
- A caller calls a phone number assigned to your Seamly project.
-
Seamly sends an authenticated
POSTrequest to your conversation endpoint. - Your application validates the request and selects the interaction mode for that call.
-
Your application returns
201 Createdwith the required configuration and a secure WebSocket URL. - Seamly opens the WebSocket connection.
- Seamly and your application exchange text or audio, depending on the selected interaction mode.
- The WebSocket connection remains active until the call ends or is transferred.
The interaction mode can be selected separately for every incoming call.
Next, follow the implementation guide for your chosen interaction mode to get started: