WebCall API V1
This document explains how to initiate a new web call through our API. Creating a call provides you with a unique callId and a WebSocket path, which you can then use to establish a real-time connection and interact with the agent.
POST /calls/public/create-web-call
POST /calls/public/create-web-callCreates a new web-based call session authenticated via API key.
Response: Returns a unique
callIdand awebSocketPath.Usage: Clients (such as web widgets) can use the returned path to establish a real-time WebSocket connection with the call for live interaction with the agent.
π Authentication
Prerequisite: This endpoint requires a valid API access key.
Required headers:
x-api-access-key: <API_KEY>
voicehub-agent-id: <yourAgentId>
Content-Type: application/jsonvoicehub-agent-id
Dataqueue Agent Id used to register this call. Note: All your agent configuration will apply for this call.
x-api-access-key
API key for authenticating the request
Content-Type
Must be application/json
π§Ύ Request Body
{
"type": "text | WebAudio | TextAudio",
}Field descriptions:
type
string
Defines the call mode: β’ text β Text-only chat with the agent. β’ WebAudio β Audio-only conversation with the agent. β’ TextAudio β Combined text and audio communication with the agent.
β
Example Request
π CORS
This endpoint supports cross-origin requests.
π» Example cURL
π€ Response
Status: 201 Created
callId
string
A unique identifier for the newly created call session.
webCallSocketPath
string
The URL path used to establish a real-time WebSocket connection with the agent for live interaction and communication.
β Error Responses
400
Misconfigured agent
401
Invalid API key
403
Insufficient credits
405
Operation not allowed
After sending this request, the response includes a callId and a webCallSocketPath. Use this path to establish a WebSocket connection and interact with the agent in real time using the callId.
For detailed instructions on connecting to the call via WebSocket, seeWebCall Socket V1
Last updated