Skip to main content
POST

Authorizations

Authorization
string
header
required

Your workspace secret key, sk_live_ followed by 32 hex characters. Create one in the console under Developers.

Headers

Idempotency-Key
string

Up to 255 characters. The same key within 24 hours replays the first answer and creates nothing new. Build it from your own record, such as order-8842-reminder-1.

Maximum string length: 255

Body

application/json
agent_id
string

The agent that runs the call. Required for channel phone and web. Optional for channel realtime: without it the session starts with an empty prompt, no tools, no greeting, the default voice and automatic language, and the Realtime client's session.update configures it. A realtime session never plays the agent's first_message; the client's first response.create starts the conversation.

Minimum string length: 1
agent_revision
integer
Required range: x >= 1
allowed_tools
string[]

The only tools of the agent that may run on this call, by name. Every other tool is turned off for this call in every phase (pre_call, on_call and post_call, builtins included), exactly as if the agent had turned it off; the builtin end_call always stays as the agent configured it, so the agent can still hang up. [] turns every tool off. Omitted or null: every tool the agent has on runs, as before. A name that is not one of the agent's tools is ignored, not refused, and a tool the agent has turned off stays off. At most 64 names of up to 64 characters, no repeats (400 invalid_request). Echoed as allowed_tools on the 202 and the call object when sent. Not accepted for channel realtime (400 invalid_request).

Maximum array length: 64
Required string length: 1 - 64
call_settings
object

This call's voice and languages, each key over the agent's (and, later, under a pre_call tool's call_settings). voice.voice_id is the older spelling of call_settings.voice_id; both with different values is 400 invalid_request. An unknown key, an unknown voice or language is 400 invalid_request naming the allowed values. The effective values and their sources are on the call object as call_settings.

caller_name
string
channel
enum<string>
default:phone

phone dials to; the answer adds events_url (live events). web is a browser session: no to, no route; the answer adds ws_url and events_url. realtime is an OpenAI Realtime-compatible session with the same rules, answer and per-minute price as web, except that it is refused (429 concurrency_limit) rather than queued when no voice slot is free; first_message, system_prompt, timing, allowed_tools, test and flow agents are not accepted on it.

Available options:
phone,
web,
realtime
final_results
boolean
default:false

Send one consolidated call.processed after the call ends, once its transcript, any analysis or post-call tools and a flow agent's outcome settle, carrying data.transcript (and data.call.flow for a flow agent). Requires webhook_url.

first_message
string

Replaces the agent's opening line for this call only. {{var}} placeholders are substituted and validated like the agent's first_message. Not accepted for channel realtime.

Required string length: 1 - 500
from
string
max_duration_secs
integer
metadata
object

Your own correlation ids (for example session_id, user_id). Frozen with the call and echoed unchanged in the call object and every webhook's data.call. Never given to the agent. Serialized size at most 4096 bytes. Do not put secrets here.

phone_number_id
string
pool_id
string
recording_enabled
boolean

Store the call's audio. Default true; a workspace whose policy disables recording defaults to false and answers true with 403 recording_disabled.

route
string
system_prompt
string

Replaces the agent's system prompt for this call only; the agent, its revision and every other setting stay the agent's. {{var}} placeholders are filled from this call's variables and validated like the agent's system_prompt (with an input_schema, each must be a declared input, a system variable or a pre-call tool output). Stored with the call but never returned on the call object or in webhooks. Not accepted for channel realtime (400 invalid_request) or for a flow agent (409 flow_system_prompt_unsupported). A sync pre_call tool may set the call's prompt instead (a top-level system_prompt string in its result, up to 48000 characters); one sent here wins over the tool's.

Required string length: 1 - 16000
test
boolean
tier
string
timing
object

Web and phone calls only (not realtime). Seconds count from live media start; max_duration_secs stays the hard cap. The *_before_end values must be at most the call's effective max_duration_secs minus 10, and close_secs_before_end less than wrap_up_secs_before_end when both are set.

to
string
variables
object

The agent's inputs for this call, checked against its input_schema (without one, string values only). Each value, as text (an object or array as its JSON), is at most 512 characters, except an input the agent's input_schema declares as an object, an array or a string with maxLength above 512, which may be up to 49152 characters. At most 65536 bytes in all. An over-long value is 400 invalid_request naming the key and its limit.

voice
object
webhook_url
string

Response

Accepted, not dialled yet

202 response of POST /v2/calls. Web calls and realtime sessions add the session credentials (ws_url and events_url); a phone call adds events_url. Both are paths the public edge makes absolute. transport names the channel of a web call or realtime session.

id
string
required
status
enum<string>
required
Available options:
queued
allowed_tools
string[]

Echo of the request's allowed_tools, present only when it was sent (an idempotent replay repeats it). A client that sent allowed_tools and finds no echo is talking to a server that did not apply it: it should abort the call (POST /v2/calls/{id}/abort) rather than connect to it.

events_url
string

Live events (Server-Sent Events) path with a reusable read-only token, valid for the call's maximum duration plus one hour. Returned for phone calls, web calls and realtime sessions. An idempotent replay repeats it while the token is valid.

transport
enum<string>
Available options:
web,
realtime
ws_url
string

Browser audio socket path with a single-use token. Expires at ws_url_expires_at (300 seconds). An idempotent replay repeats it only while the token is unused.

ws_url_expires_at
string<date-time>