Supported Transports
Setup
Phone numbers (Twilio / WhatsApp)
Bind withrouting_target_type: "webhook":
WebRTC
Passserver_url in requestData:
variables beside server_url reach your server as call.variables, and win
a clash with the ones you answer — see WebRTC.
Outside development server_url must be https:// (a number’s is a 422, a
WebRTC one a 400), except a Kubernetes Service in the same cluster, whose host
ends in .svc or .svc.cluster.local. Loopback and private addresses are not
exempt. An inline agent you answer with is not refused for a plain-http tool
or MCP URL, but deliveries to one are logged as plain_http_delivery, at most
once a minute per kind and naming only the host. See
Compliance.
Your Server Receives
call.id is the id the call is created with — the call_id of its events,
its webhooks and GET /v1/calls/{id} — so you can match the call-init you
answered to everything the call does after it. (A text conversation’s is the
session’s id; see below.)
Outbound calls
An outbound call placed from a webhook-routed number (POST /v1/calls/outbound
or a campaign) runs call-init too, at the dial, before the phone rings. The
roles are the same as inbound: phoneNumber is your number, customer the
person called. call also carries agent_id, the agent the dial named, and
variables, the dial’s (a campaign target’s) template variables, when it has
any. provider_call_id is empty: nothing has been dialled yet.
- Your answer’s
agent_id(an agent in the same project) or inlineagentruns the call; with neither, the dial’s agent does. - Your
variablesare merged under the dial’s: on a clash the dial’s value wins. Yourmetadatais stored as on an inbound call (the call’smetadata.metadata), andknowledge_contextlikewise. - A call-init that fails, times out, or names an agent that cannot run (an
invalid inline config, an
agent_idthat is not one of the project’s) does not stop the dial: the dial’s agent runs with the dial’s own variables and metadata, none of your answer, and a warning is logged. - Call-init runs after the project’s limits admit the dial, so a refused dial never reaches your server.
Text conversations (SMS, WhatsApp text)
A text to a webhook-routed number runs call-init once per conversation: on the message that opens a session, never on the ones after it.call.id is the
id the session is created with (the session_id of its events), call.type
is inboundSms or inboundWhatsAppMessage, and provider_call_id is empty.
- Your answer’s
agent_id(an agent in the number’s project) or inlineagentanswers the conversation. An inline agent has no agent row: the session’sagent_idis null, and its config is never shown by the API. variables,metadataandknowledge_contextare kept on the session and apply to every reply in it, as they do for a whole call.- A call-init that fails, times out, or names no agent that can run leaves the message unanswered (an SMS gets a short apology) and opens no session; the next message asks again.
- The session expires after 24 hours without a message; the next text opens a new one, and asks again.
Verify the Signature
Each call-init request is HMAC-signed with the number’sserver_url_secret (returned when you bind the number). Headers: X-TurnCall-Signature: v1=<hex> and X-TurnCall-Timestamp; the HMAC-SHA256 is computed over "{timestamp}.{raw_body}" — the same scheme as event webhooks.
Response Options
- Agent ID
- Agent ID + Variables
- Inline Agent
- Full Response
Response Fields
What Happens
1
call.initializing webhook event fires (informational)
2
Template {{variables}} are rendered into the system prompt
3
knowledge_context is prepended to the system prompt
4
metadata is stored on the call record
5
call.started event fires
6
Pipeline starts with the resolved configuration
Returning an inline agent
agent and agent_id are alternatives, not a merge: an inline agent
replaces the configuration for that call rather than overriding parts of a
stored one. Send the whole config, not a patch.
Because an inline agent is not a stored agent, it has no row to point at, and
that is visible to you:
Everything else still works. The configuration the call ran with is recorded on
the call itself, so post-call analysis, the transcript and the call.ended
webhook are unaffected. Correlate such calls through call_id, or through
metadata you returned in the call-init response — that is what it is for.
That recorded configuration is never shown back. It can carry credentials — MCP
headers, an llm.api_key, AWS keys — so the call read and call.ended leave it
out of metadata, and a text session’s is not in any session read. Only
call-init can give a call an inline agent: metadata.dynamic_config on
POST /v1/calls/outbound is refused with a 422.
Knowledge bases linked to a stored agent do not apply, since the call does not
run that agent. An inline agent names its own in knowledge_bases, with the
same fields as a link (knowledge_base_id, mode, priority, top_k,
similarity_threshold, tool_description):
skills, as a stored agent does. A name the project has no published version
of is skipped with a warning, and the call starts without it.