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

Creates a new web-based call session authenticated via API key.

  • Response: Returns a unique callId and a webSocketPath.

  • 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
Header
Description

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:

Field
Type
Description

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

Field
Type
Description

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

Status
Description

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