Skip to main content
POST
/
api
/
calls
/
create-web-call
curl -X POST "https://api.zudu.ai/api/calls/create-web-call" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
  -d '{
    "agent_id": "agent_1234567890",
    "metadata": {
      "customer_id": "cust-001",
      "session_type": "support"
    }
  }'
{
  "message": "Web call created successfully",
  "status": "success",
  "error": null,
  "data": {
    "organization_id": "org_1234567890",
    "call_type": "web_call",
    "call": {
      "call_id": "call_abc123def456",
      "agent_id": "agent_1234567890",
      "organization_id": "org_1234567890",
      "call_status": "REGISTERED",
      "call_type": "WEB_CALL",
      "created_at": 1705320000000
    },
    "web_call_info": {
      "room_name": "call_abc123def456",
      "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
      "call_status": "ongoing",
      "agent_id": "agent_1234567890"
    },
    "livekit_connection": {
      "server_url": "wss://communication.zudu.ai",
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
      "room_name": "call_abc123def456"
    }
  }
}
Create a web call record and generate LiveKit access token for browser-based calling. Perfect for web applications that need real-time voice communication.
curl -X POST "https://api.zudu.ai/api/calls/create-web-call" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
  -d '{
    "agent_id": "agent_1234567890",
    "metadata": {
      "customer_id": "cust-001",
      "session_type": "support"
    }
  }'
{
  "message": "Web call created successfully",
  "status": "success",
  "error": null,
  "data": {
    "organization_id": "org_1234567890",
    "call_type": "web_call",
    "call": {
      "call_id": "call_abc123def456",
      "agent_id": "agent_1234567890",
      "organization_id": "org_1234567890",
      "call_status": "REGISTERED",
      "call_type": "WEB_CALL",
      "created_at": 1705320000000
    },
    "web_call_info": {
      "room_name": "call_abc123def456",
      "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
      "call_status": "ongoing",
      "agent_id": "agent_1234567890"
    },
    "livekit_connection": {
      "server_url": "wss://communication.zudu.ai",
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
      "room_name": "call_abc123def456"
    }
  }
}

Headers

X-API-KEY
string
required
Your API key (format: sk_...)
X-API-SECRET
string
required
Your API secret (format: s3cr3t_...)

Request Body

agent_id
string
required
The ID of the agent to use for this web callExample: "agent_1234567890"
metadata
object
Optional metadata to attach to the callCan include any custom fields like:
  • customer_id: Customer identifier
  • session_type: Type of session (e.g., “support”, “sales”)
  • priority: Priority level
Example:
{
  "customer_id": "cust-001",
  "session_type": "support"
}
is_widget_call
boolean
Whether this is a widget-based callDefault: false

Response Fields

data.call_id
string
The unique identifier for the created callFormat: call_...
data.web_call_info
object
Web call connection informationIncludes:
  • room_name: LiveKit room name for the call
  • access_token: LiveKit JWT token for connecting
  • call_status: Current status of the call
  • agent_id: The agent ID assigned to this call
data.livekit_connection
object
Complete LiveKit connection detailsIncludes:
  • server_url: LiveKit server WebSocket URL
  • token: LiveKit access token
  • room_name: Room name to connect to

Error Responses

error
string
Bad Request - Missing required fields or invalid agent ID
{
  "message": "Missing required fields",
  "status": "error",
  "error": "agent_id is required for web calls"
}
error
string
Not Found - Agent does not exist
{
  "message": "Agent not found",
  "status": "error",
  "error": "Agent with ID 'agent_123' does not exist in organization 'org_123'"
}
error
string
Unauthorized - Missing or invalid API key/secret

Notes

  • The organization ID is automatically extracted from your API key
  • A unique call ID is automatically generated if not provided
  • The LiveKit access token is ready to use immediately for browser connections
  • The room name matches the call ID for easy tracking
  • Agent validation ensures the agent exists and belongs to your organization