Overview
The URL you pass as webhookUrl on POST /api/v1/outbound/calls is where CallNode runs your AI agent during the call. It is HTTP POST, JSON in / JSON out, and is invoked once when the call connects, then once per turn — for every user utterance the transcription engine finalises, and for every keypad (DTMF) entry the caller completes.
You can host this endpoint anywhere — n8n, Flowise, a Cloud Function, your own server. The only requirements are (a) it accepts a JSON POST, (b) it returns a JSON object in the shape documented below, and (c) it responds within a few seconds. The bridge waits up to 30 seconds, but the caller hears nothing while it waits.
This is one of two ways to drive a call. The other is the realtime WebSocket, one socket per call for code integrations. Both accept text: answer with your own audio, or with replyText alone and CallNode speaks it in the voice chosen on the number (see text-only replies). Playback, barge-in, transfers and hangup behave the same on both.
webhookUrl stored on the called PhoneNumberrecord (Dashboard → Phone Numbers). The request and response shape on this page applies to both inbound and outbound calls.Authentication (request side)
We send whatever auth you configure via the webhookAuth field on originate (outbound) or the auth fields on the phone number record (inbound). Supported types: none, basic, bearer, header (custom header name).
Events we send to you
call_started
Fired once when the called party answers (outbound) or when the caller connects (inbound). Reply with the greeting / opening line.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"event": { "type": "call_started" },
"meta": {
"from": "+15145550199",
"to": "+16135551234",
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a"
}
}user_speech
Fired every time the transcription engine finalises a user utterance. The transcript field holds the full final transcript; conversationHistory echoes the full assistant/user turn log to date so your AI agent has context even if it is stateless.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"event": { "type": "user_speech" },
"transcript": "I'd like to book a demo for next Wednesday at 10 AM.",
"conversationHistory": [
{ "role": "assistant", "content": "Hi, this is Hal from CallNode...", "timestamp": 1780173386556 },
{ "role": "user", "content": "Yes, I'm interested.", "timestamp": 1780173401200 }
],
"meta": {
"from": "+15145550199",
"to": "+16135551234",
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a"
}
}user_dtmf
Fired when the caller enters digits on the phone keypad. Digits accumulate into one turn and are submitted when the caller presses #, enters 32 digits, or stops typing for about 2.5 seconds — whichever comes first. The # terminator submits the buffer and is not included in it. The digit string arrives in the dtmf field, and transcript carries the same string, so an agent that only reads transcript handles keypad turns with no changes. Valid digits are 0-9, *, and A-D.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"event": { "type": "user_dtmf" },
"dtmf": "1042",
"transcript": "1042",
"conversationHistory": [
{ "role": "assistant", "content": "Please enter your 4-digit account PIN, followed by pound.", "timestamp": 1780173386556 }
],
"meta": {
"from": "+15145550199",
"to": "+16135551234",
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a"
}
}A keypress while your audio is playing stops the prompt (barge-in), so callers can key ahead through menus they already know. Keypad input is paused while a transfer is in progress.
event.type === "user_dtmf" and dtmf === "1" in your workflow, and reply with transfer: true:{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"replyText": "Connecting you to our sales team now.",
"publicAudioUrl": "https://cdn.yourdomain.example/audio/menu-sales.mp3",
"transfer": true,
"transferDestination": "+15145559999"
}Response shape
Return JSON with these fields. The bridge plays the audio at publicAudioUrl to the caller, optionally followed by a hang-up or transfer if you signal one.
| Field | Type | Required | Description |
|---|---|---|---|
publicAudioUrl | string (URL) | Required | HTTPS URL to a playable audio file (MP3 or WAV). The bridge downloads, transcodes to 8 kHz mono PCM, and plays. It must be a public address: a loopback, private or internal address is refused and the reply is not played. Required unless you return replyText alone and let CallNode speak it (see text-only replies). |
localAudioPath | string | Optional | Older name for publicAudioUrl, read only when that field is absent. It must be an http(s) URL as well; a file path is not accepted. |
replyText | string | Optional | The text being spoken. With an audio URL present it is logged for the transcript only. Without one, CallNode renders it in the number's voice and plays that (billed, see below). |
callId | string | Optional | Echo of the call ID for your own logging. We already know it. |
hangup | boolean | Optional | When true, the bridge plays the audio and then immediately emits a <hangup/> in the same response. Use this when the AI says a closing line so the call doesn't sit in silence afterward. endCall is accepted as an alias. |
endCall | boolean | Optional | Alias for hangup. Use whichever fits your workflow. |
transfer | boolean | Optional | When true and transferDestination is set, the bridge plays the audio (if provided), then bridges the call leg to the destination. |
transferDestination | string (E.164 or sip: URI) | Optional | Required when transfer is true. An E.164 number, or a sip:user@host[:port][;transport=udp|tcp] URI to hand the caller to your own PBX/SBC. SIP transfer legs bill at your plan's SIP egress rate and have no phone-network fallback. The host must be public and is checked when the transfer is placed: a transfer to a host that points at a private or internal address, or does not resolve, is not placed and the caller stays with your agent. A SIP redirect (a 3xx answer) from the endpoint is not followed. |
```json blocks, or any envelope keys like output. The bridge does strip common wrappers defensively, but the cleanest contract is a bare JSON object starting with { and ending with }.Text-only replies (CallNode speaks them)
If your agent produces text but no audio, return replyText (a plain string in reply or text is accepted too) and omit the audio fields. CallNode renders the text in the voice chosen on the number (number page → Voice for spoken replies; the platform voice when none is chosen) and plays it, then listens as usual. hangup and transfer work exactly as with your own audio.
- This is how a Flowise flow, or any plain LLM endpoint, drives a call without its own speech engine: point the number's webhook at the prediction URL with the API key as a bearer token; the request carries
questionand a per-call session id, and the flow's text answer is spoken. - On
call_started,questionasks for the greeting. On an incoming call it is “A caller just connected. Greet them briefly and ask how you can help.” On a call you placed it is “The person you called has just answered the phone. Greet them, say who you are and why you are calling.” Add?name=Jane%20Smithto the call'swebhookUrland it also says “You are calling Jane Smith.” The name is cleaned of symbols and cut to 80 characters. - Rendering takes a few hundred milliseconds per sentence on top of your agent's time. Keep replies short; up to 1000 characters per turn are spoken.
- Ending or transferring from a text-only agent. A plain string cannot carry
hanguportransfer, so two markers stand in for them: end the reply with[hangup]and CallNode speaks the rest, then hangs up; end it with[transfer: +15551234567](or asip:address) and the caller hears the sentence, then the transfer runs through the usual gates. The marker itself is never spoken. A JSON object inside the text, with or without code fences, is accepted too. Without either, the call stays open until the caller hangs up or two minutes of silence pass. - Billing: the realtime rate (
realtimePerMinuteRateonGET /api/plans) per started minute of the call, charged once at call end and only on calls where at least one reply was rendered, as a “Spoken replies” line on Billing → History. Calls where every reply carried its own audio pay nothing extra. With Premium Voice chosen as the number's voice tier, the rate isrealtimePremiumPerMinuteRateinstead, applied only when every spoken reply on the call was rendered by the Premium engine.
Response examples
Continue the conversation
The most common case — play audio, listen for the next turn.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"replyText": "Got it. What's the biggest bottleneck with your current calling setup?",
"publicAudioUrl": "https://cdn.yourdomain.example/audio/reply-xyz456.mp3"
}End the call after a closing line
Set hangup: true only when the conversation has naturally concluded: demo booked, prospect firmly declined, voicemail handled, goodbye exchanged. Avoid using it to escape an objection.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"replyText": "Perfect, you're booked for Wednesday at 10 AM. I'll send the calendar invite right now. Talk soon!",
"publicAudioUrl": "https://cdn.yourdomain.example/audio/reply-abc123.mp3",
"hangup": true
}Transfer to a live agent
Play an optional handoff line, then bridge the call to a real number.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"replyText": "Connecting you to a specialist now...",
"publicAudioUrl": "https://cdn.yourdomain.example/audio/transfer-notice.mp3",
"transfer": true,
"transferDestination": "+15145559999"
}transferDestination also accepts a sip: URI (e.g. sip:support@pbx.example.com) — played-audio-then-transfer works identically, so "press 1 → ring my PBX" flows need no phone-network leg at all. The SIP transfer leg bills at your plan's SIP egress rate; your endpoint must accept traffic from 198.27.122.194 and 192.95.44.47 (calls may leave from either switch).
When to set hangup: true
- Demo booked and confirmed (date, time, and acknowledgement).
- Prospect firmly declines and there is no remaining path forward.
- Voicemail detected and your reply leaves the brief message.
- Prospect explicitly asks to end the call ("I have to go", "stop calling").
- Wrong number or the intended recipient is unavailable.
- A goodbye has been exchanged after a natural conclusion.
For every other turn — including mid-discovery, mid-pitch, mid-objection, or while still working toward a booking — hangup must be false (or omitted).
Latency budget (measured)
The number that matters in a conversation is the gap between the caller finishing a sentence and hearing the reply. This loop is a synchronous round trip per turn, so that gap is the sum of the stages below. Figures are medians and 90th percentiles from production traffic, measured on 2026-09-06 over the last 300 turns:
- End of speech to dispatch (our settle window that avoids cutting a caller off mid-sentence): 350 ms median, 1.5 s p90.
- Your webhook round trip — your LLM, your TTS render, your upload, our download and transcode: 2.8 s median, 4.5 s p90. Our download plus transcode inside that: 0.4 s median, 1.1 s p90.
- Playback pickup (the next poll that starts the audio): 0.3 s median, 1.2 s p90.
End to end that is roughly 3.4 s at the median and about 7 s at the 90th percentile, of which about one second is CallNode's and the rest is your stack. What moves it: a fast LLM, streaming-capable TTS, hosting the audio file close to us (US East), and keeping replies short. For conversations where sub-second turns matter and you are writing code, the realtime WebSocket mode removes the per-turn round trip and the audio-file hop; this webhook stays the fallback behind it.
Timeouts and retries
The bridge waits up to 30 seconds for each response; on calls to one of your numbers it waits that number's voice.webhookTimeout instead (1 to 120 seconds). Slower replies are logged as [TIMING] Slow webhook reply and degrade caller experience; consistently slow replies risk the caller hanging up before audio arrives. If your endpoint fails, times out or returns non-2xx, the bridge tries twice more, one second apart (an HTTP 401 is not retried), before giving up on that turn. Each attempt gets the full timeout.
call_started) is the latency the caller feels most. Pin your TTS provider to its lowest-latency voice/model and keep the greeting short.