Skip to main content
POST
/
v1
/
web-calls
/
token
Create web call token (publishable key)
curl --request POST \
  --url https://api.oneinbox.ai/v1/web-calls/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_id": "<string>",
  "variables": {
    "customer_name": "Suman"
  },
  "metadata": {
    "source": "homepage_widget"
  }
}
'
{
  "id": "call_abc123",
  "agent_id": "<string>",
  "type": "web",
  "room_name": "web-2006ff52",
  "server_url": "wss://voice.oneinbox.ai",
  "participant_token": "eyJhbGciOiJIUzI1NiJ9...",
  "created_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.oneinbox.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use a publishable key (oi_pk_…) created in the OneInbox dashboard under Settings → Publishable Keys. Safe to embed in front-end code — scoped to web calls only and locked to registered origins.

Body

application/json

Request body for POST /v1/web-calls/token. Used by the Web SDK when starting a call with a publishable key. Identical to WebCallRequest but without overrides.

agent_id
string
required

ID of the agent to connect to (agt_…).

variables
object

Per-call template variables interpolated into the agent prompt.

Example:
{ "customer_name": "Suman" }
metadata
object

Free-form key/value pairs stored on the call record.

Example:
{ "source": "homepage_widget" }

Response

Created

id
string
Example:

"call_abc123"

agent_id
string
type
string
Example:

"web"

status
enum<string>
Available options:
queued,
initiated,
in_progress,
completed,
failed
room_name
string

Internal room name

Example:

"web-2006ff52"

server_url
string

WebSocket server URL (wss://voice.oneinbox.ai). Your frontend connects here using participant_token.

Example:

"wss://voice.oneinbox.ai"

participant_token
string
Example:

"eyJhbGciOiJIUzI1NiJ9..."

created_at
string<date-time>