- call-init — a request TurnCall makes to your server URL before a call starts. Your answer picks the agent and fills its variables. It is the only event sent to a server URL.
- webhook events — everything that happens during and after a call (transcripts, tool results, transfers, failovers, the end of the call), delivered to the URLs you subscribe with
POST /v1/webhooks. They are fire-and-forget: your response is ignored.
call-init
Bind a phone number withrouting_target_type: "webhook":
server_url in the body of POST /v1/webrtc/connect instead. The request and the answer are described in call-init.
Webhook events
events is a list of event types, or ["*"] for all of them. The response carries the signing secret, once. To change the list later without changing the secret, use PATCH /v1/webhooks/{id} with a new events.
A subscription’s url and a number’s server_url must be https:// outside development, or the request is a 422. A Kubernetes Service in the same cluster (a host ending in .svc or .svc.cluster.local) may be http://; loopback and private addresses may not. See Compliance for ALLOW_PLAIN_HTTP_URLS.
Every delivery is one envelope:
event_id is stable across retries: use it to drop a redelivery.
metrics.turn, delegation.completed, avatar.unavailable (why a call’s video Avatar did not show; see Video Avatar) and a procedure’s moves are stored on the call’s event log (GET /v1/calls/{id}/events) and never delivered. A move the procedure allowed is a procedure.step {procedure, from, to, kind}, where kind is the kind of the step it reached, and a procedure’s start is one with from null; a move it refused is a procedure.refused {procedure, from, to}; a procedure a handoff ended before it reached an end or escalate step is a procedure.left {procedure, from, reason}, from the step it was left at and reason handoff.
Tool calls go to each tool’s own webhook_url — see Tools.
call.ended carries skills, every skill the call resolved with its version, whether the agent pinned it and whether it was loaded (an empty list when the agent has none), as the call read does. See Skills.
call.ended carries procedures, what the call did of each procedure, as the call read does. See Procedures.
call.ended carries the call’s retention: how many days its recording, transcript and events are kept, null for good. See Retention.
Redaction
If the project has redaction on, every webhook payload is redacted before it is sent, and a call’s events before they are stored on its event log. A subscriber never sees a redacted value, and it cannot be recovered from the webhook, from a redelivery or fromGET /v1/calls/{id}/events, which hold the same redacted payload. The one exception is a call that was live when redaction was turned on: see “A change applies to the next event” below.
A detected value is replaced by its type in angle brackets, and the rest of the text is kept:
- Text, at any depth. Every string in the payload is analysed:
textontranscript.final, a tool’s arguments and result ontool.result, a transfer’s or a handoff’s reason and message, an error’s text, and incall.endedthetranscript,summary,analysis(takeaways included) and the call’smetadata. A JSON number of seven digits or more inside them is analysed as the digits it is written with, so{"phone": 4155550132}in a tool’s arguments reads{"phone": "<PHONE_NUMBER>"}. Thesession.*andchat.createdevents of text conversations are redacted the same way. Campaign and eval-run events go through the same step. - Number fields, whole. With
PHONE_NUMBERchosen (it is in the default), the phone number fields at the top of a payload (from_number,to_numberand the others, your own TurnCall number included) read<PHONE_NUMBER>when they hold a phone number. Which fields, and what happens to a value that is not a phone number (a WebRTC call’s"webrtc", a SIP address): Number fields. - Never analysed: the envelope (
call_id,event_idand the rest), and TurnCall’s own fields at the top of a payload: ids, timestamps, statuses,ended_reason,direction, provider and model names,tool_name, URL fields such asrecording_url, and numbers such asduration_ms. So you can still join an event to its call and dedupe it. Fields inside your own data (metadata, a tool’s arguments, a takeaway) are analysed whatever they are called.
GET /v1/calls/{id} keeps from_number and to_number, and routing, the suppression list and campaigns use them as before. Redaction applies to what is stored and sent, not to the call itself.
When the detector is unavailable, text is withheld, never sent raw. If the detector fails to load, every string it would have analysed arrives as <REDACTED> for five minutes, and then the load is tried again; a server that falls far behind withholds text the same way rather than queue it. A number field that holds a phone number does not need the detector and still reads <PHONE_NUMBER>; one that holds anything else is withheld with the text. The event log holds <REDACTED> too, so the original cannot be read back later.
A change applies to the next event. Turning redaction on or off, or changing its types, applies at once on the server that took the change and within 30 seconds on the others. Events already sent are not sent again, and a call that was live during the change can have both kinds of payload. Its call.ended is sent after the change, but its transcript is the one stored on the call’s event log: lines stored before redaction was turned on are sent as they were, unredacted.
Not redacted:
- call-init and tool webhooks. They are part of the live call, and your server answers them with the raw values: call-init receives the caller’s number, and a tool’s
webhook_urlreceives the arguments the model gave it. - The recording. Redaction is text only.
recording.readyandrecording_urlpoint at the full audio; keep it briefly with a retention policy.
Signature Verification
All server events include HMAC-SHA256 signatures:"timestamp.body" with the signing secret: for call-init, the one returned when you bound the phone number; for webhook events, the one returned when you created the subscription. Compare in constant time, and refuse a timestamp more than five minutes old so a captured delivery cannot be replayed (a retry is sent within about two minutes, with its original timestamp and signature).