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-call
Creates a new web-based call session authenticated via API key.
Response: Returns a unique
callId
and 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/json
voicehub-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
{
"type": "WebAudio",
}
🌐 CORS
This endpoint supports cross-origin requests.
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Allow-Headers: Content-Type, Authorization, voicehub-agent-id, x-api-access-key
💻 Example cURL
curl -X POST "https://voicehub.dataqueue.ai/calls/public/create-web-call" \
-H "Content-Type: application/json" \
-H "voicehub-agent-id: agent_123" \
-H "x-api-access-key: sk_live_abc123" \
-d '{
"type": "TextAudio"
}'
📤 Response
Status: 201 Created
{
"callId": "<call-shortuuid>",
"webCallSocketPath": "<socket path>"
}
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