Integration Guide for Websocket Connection#
This documentation provides a comprehensive integration guide for connecting third-party telephony platforms (like Exotel, Twilio, Knowlarity) with Formi's AI-powered voice interaction system via WebSockets.Overview#
Formi enables intelligent AI-powered voice interactions over websocket through real-time audio streaming. This guide is for any client or partner integrating third-party telephony services (e.g., Exotel, Twilio, Knowlarity, etc.) with Formi using WebSockets.This documentation provides a comprehensive guideline on how to:1.
Set up call metadata exchange with Formi
2.
Initiate or reuse a session on Formi’s platform
3.
Establish a direct WebSocket connection with Formi
4.
Stream and receive audio in real-time
When a voice interaction is initiated or answered, your telephony provider should trigger a WebSocket stream to Formi's URL that includes essential call metadata. This metadata helps Formi:1.
Identify the interaction, session and any previous interaction context.
2.
Associate the call with the correct agent.
3.
Attach the or business logic to the session Methods to set Interaction#
Inbound Interactions
Use Formi's Create Session API to explicitly initiate the sessionOutbound Interactions
Setup and Source & Queue Calls on our SystemConstruct the WebSocket URL#
Formi expects WebSocket connections in the following format:
Parameter | Description |
---|
call_type | inbound, outbound, confirmation, or missed |
agent_id | The Formi agent ID |
outlet_id | The outlet or business unit ID |
CallFrom | Customer contact ID (phone or email) |
CallSid | Unique call identifier generated by your system |
session_id | Returned by Formi Create Session API |
interaction_id | Returned by Formi Create Session API |
Sample Usage#
Establish the WebSocket Connection#
Once the WebSocket URL is constructed, the telephony system must initiate a WebSocket connection and begin sending a predefined sequence of structured messages to Formi.WebSocket Message Types#
Below is a list of all supported message types, along with parameters and examplesFinal Notes#
Always call the Create Session API before the call stream starts.
Keep session_id and interaction_id safe and link them with your call.
Formi supports additional analytics, transcriptions, and AI decisioning layered on top of the stream.
Use secure wss:// URLs and validate endpoints before opening connections.
Modified at 2025-07-12 11:54:15