Voice AI Webhooks: Events, Payloads and Function Calling
Last verified · by Topcalls Team
Quick answer
A voice AI platform plugs into your stack three ways: webhooks, a REST API and function calling. Topcalls sends one JSON POST to your HTTPS endpoint when each call ends, with transcript, recording, summary and disposition, and the agent can call your tools mid-call.
1 POST per call
The details
Topcalls pushes one JSON POST to your server when a call ends. You do not poll. The same payload shape arrives for completed, failed and cancelled calls, and the status field tells them apart, so one endpoint can handle all three.
You can attach a webhook in three places: a webhook_url on a single call, a webhook_url on a campaign, or an account-level subscription created with POST /v1/webhooks that catches every matching call however it was created. The first two accept a webhook_call_status_filter on the telephony outcome. Subscriptions take filters on any payload field instead.
Function calling works the other way round. During the call, the agent can use a tool you attached to the campaign, such as checking a calendar or updating a CRM record, and it works the result into its next reply. Each tool use is then written into the transcript your webhook receives, so one payload tells you what was said and what the agent did.
Everything below comes from the Topcalls call gateway code and its developer docs. AI calls start from $0.25/min.
Which webhook events does Topcalls send?
| Event | When it fires | Status |
|---|---|---|
| call.completed | Every call that ends, including failed and cancelled calls. Check status in the payload. | Sent |
| call.completed.<disposition> | A call ends with that disposition. The suffix is the label as a slug, so Booked Callback becomes call.completed.booked_callback. | Sent |
| lead.status_changed | Accepted by validation, but nothing emits it. | Not sent |
| campaign.activated | Accepted by validation, but nothing emits it. | Not sent |
| campaign.paused | Accepted by validation, but nothing emits it. | Not sent |
How does voice AI integrate with APIs and webhooks?
Three layers, each with one job. Webhooks push results out when a call ends. The REST API lets your code create calls, campaigns and subscriptions and read calls back. Function calling lets the agent reach into your systems during the call.
For a CRM or helpdesk, most teams start with one webhook on the call.completed event and write the disposition, summary and recording link to the contact. If you only want the calls that matter, subscribe to a disposition event or add an is_conversion filter instead of filtering in your own code.
- Webhook: one JSON POST per ended call, to a public HTTPS URL you control.
- REST API at api.topcalls.ai: manage subscriptions with GET, POST, PATCH and DELETE on /v1/webhooks, and read any call with GET /v1/calls/{call_id}.
- Function calling: tools built as flows in Integrations and selected on the campaign, called by the agent mid-call.
- No code option: connect the same events to your CRM or calendar through no-code flows, see the integrations guide.
AI voice agent integrations guide · Topcalls integrations · Connect AI calls to your CRM
What does a call.completed webhook payload look like?
This is the full body of a completed outbound call. Transcript speech items use the field role, with the value assistant or user. A voicemail, an automated phone menu or a transferred call carries a platform disposition instead of an analysis label. The analysis object holds whatever fields your campaign asks the post-call analysis to extract, so its keys are yours.
duration is in minutes. is_conversion is true when the disposition is in the campaign conversion outcomes, ignoring case, and it is always false on failed calls. The webhook for a completed call waits until the transcript, summary and recording are ready. If the recording never arrives, it goes without recording_url.
{
"call_id": "550e8400-e29b-41d4-a716-446655440000",
"phone_number": "+14155551234",
"from_phone_number": "+18005551234",
"direction": "outbound",
"status": "completed",
"call_status": "completed",
"duration": 2.5,
"transcript": [
{
"id": 1,
"role": "assistant",
"text": "Hi, this is Rachel from Bright Dental...",
"created_at": "2026-11-20T10:30:05.120Z"
},
{
"id": 2,
"role": "user",
"text": "Yes, hi...",
"created_at": "2026-11-20T10:30:08.450Z"
}
],
"recording_url": "https://example.com/recordings/550e8400.mp3",
"call_summary": "Confirmed the appointment for Thursday at 3 PM.",
"error_message": null,
"answered_by": "human",
"campaign_id": "9b2f6c1e-7d44-4a1b-8c3e-5f0a12345678",
"lead_id": "c41d8e52-0b7a-4f6d-9e13-a8b7c6d5e4f3",
"created_at": "2026-11-20T10:30:00Z",
"started_at": "2026-11-20T10:30:05Z",
"end_at": "2026-11-20T10:32:35Z",
"disposition": "Appointment Booked",
"is_conversion": true,
"analysis": {
"call_outcome": "Appointment Booked",
"main_objection": null
},
"metadata": {
"patient_id": "pat_123"
}
}What does a failed or cancelled call payload contain?
Failed and cancelled calls go out right away, because there is no recording to wait for. The body has the same keys as a completed call, except analysis, which is never present on this path. disposition is null and is_conversion is false. call_status carries the telephony outcome, such as no-answer or busy, which is the value webhook_call_status_filter matches on.
{
"call_id": "7f3e9a52-1c4b-4d8e-9a6f-2b5c8d1e0f34",
"phone_number": "+14155551234",
"from_phone_number": "+18005551234",
"status": "failed",
"call_status": "no-answer",
"duration": null,
"transcript": null,
"recording_url": null,
"call_summary": null,
"error_message": "No answer",
"answered_by": null,
"campaign_id": "9b2f6c1e-7d44-4a1b-8c3e-5f0a12345678",
"lead_id": "c41d8e52-0b7a-4f6d-9e13-a8b7c6d5e4f3",
"created_at": "2026-11-20T11:00:00Z",
"started_at": null,
"end_at": "2026-11-20T11:00:32Z",
"metadata": {},
"disposition": null,
"is_conversion": false,
"direction": "outbound"
}Which extra fields appear on inbound and transferred calls?
direction is outbound when Topcalls placed the call and inbound when it came in on one of your numbers. Either way, phone_number is the other party. On inbound calls the payload also carries caller_name, the name the caller network sent, or null. If the agent tried a transfer to a person, transferred_to (the target label, never the number) and transfer_status are added.
{
"direction": "inbound",
"caller_name": "J. SMITH",
"transferred_to": "Front desk",
"transfer_status": "completed"
}How does voice AI function calling work?
The agent decides to use a tool from its description and what the caller asked, the platform runs the tool with the arguments the agent chose, and the result goes back to the agent for its next reply. Every call has a built-in end_call tool. Custom tools are flows you build in Integrations and select on a campaign, or list in the campaign mcp_tool_allowlist. A call placed with POST /v1/calls gets only end_call.
A Live call waits at most 9 seconds for a tool to answer. If a tool fails or times out, the agent is told and carries on. Answer in under 2 seconds if you can, so the line does not go quiet.
Example: the caller asks whether 3 PM tomorrow is free, the agent calls check_availability, your flow returns that the slot is open, and the agent offers to book it. The webhook then shows the tool use as its own transcript item. tool_ok is false only when a failure was reported, and it does not prove the action worked, so verify important writes in your own system.
{
"id": 4,
"role": "assistant",
"text": "",
"created_at": "2026-11-20T10:31:12.300Z",
"kind": "tool_call",
"tool_name": "check_availability",
"tool_status": "success",
"tool_ok": true
}{
"id": 9,
"role": "assistant",
"text": "",
"created_at": "2026-11-20T10:32:35.010Z",
"kind": "end",
"end_via": "caller"
}How do I subscribe to one event and handle it?
Create an account-level subscription with the event name, your URL and optional filters. Every filter key has to match. A plain value matches by equality, an array matches any of its strings, and a string containing % is a SQL LIKE pattern of at most 256 characters. Any payload field can be a key.
In your handler, answer with a 2xx first and do the slow work after. Expect the same call more than once and deduplicate on call_id. To keep only speech from the transcript, skip items that have a kind.
curl -X POST https://api.topcalls.ai/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "call.completed.booked_callback",
"url": "https://hooks.your-app.com/topcalls",
"filters": { "is_conversion": true, "direction": "inbound" }
}'app.post('/topcalls/call-ended', (req, res) => {
res.status(200).json({ received: true }); // answer inside 10 seconds, work after
const call = req.body;
if (seen.has(call.call_id)) return; // the same call can arrive twice
seen.add(call.call_id);
const items = (call.transcript ?? []).filter((i) => !i.kind); // speech only
queueCrmUpdate(call.call_id, call.disposition, call.is_conversion, items);
});What happens when a webhook delivery fails?
Your endpoint has 10 seconds to answer with a 2xx. A 4xx on any attempt is final and is never retried. A timeout, network error or 5xx is retried 1, 5, 15, 30 and then 60 minutes after the previous failure, 6 attempts in all. After the last one the delivery is dropped, but the call stays readable at GET /v1/calls/{call_id}.
The URL must use https and point at a public host. Addresses on a private or local network, localhost included, are refused, and redirects are followed up to 3 times, each to another https public URL. Payloads are not signed, so put an unguessable token in the path and reject requests without it. Test calls from the dashboard browser tester never send webhooks.
How it compares
| Entity | Value | Category |
|---|---|---|
| Delivery | One JSON POST per ended call | Webhook |
| Endpoint timeout | 10 seconds to return a 2xx | Webhook |
| Retry schedule | 1, 5, 15, 30, 60 minutes, 6 attempts in all | Webhook |
| A 4xx answer | Final, never retried | Webhook |
| Signature | None, so guard the URL with a token | Security |
| Live call tool wait | At most 9 seconds | Function calling |
| Topcalls pricing | AI calls from $0.25/min | Cost |
Sources
- Topcalls docs: Webhooks and events (2026-11)
- Topcalls docs: Webhooks guide (2026-11)
- Topcalls docs: Function calling and tools (2026-11)
- Topcalls docs: API reference (2026-11)
Frequently asked questions
How does voice AI integrate with APIs and webhooks?
Through three layers. A webhook pushes one JSON POST to your endpoint when each call ends, the REST API creates calls and subscriptions and reads calls back, and function calling lets the agent use your tools during the call. Most teams start with a call.completed webhook that writes the disposition and summary to the CRM.
What webhook events does a voice AI platform send?
Topcalls sends call.completed for every call that ends, failed and cancelled included, and call.completed.<disposition> for a single outcome, such as call.completed.booked_callback. lead.status_changed, campaign.activated and campaign.paused pass validation, but nothing sends them, so do not subscribe to them.
What is function calling in a voice AI agent?
It lets the agent act during the call: check a calendar, look up an order, update a CRM record or send a confirmation. The agent picks a tool, the platform runs it, and the result shapes the next reply. Each tool use is recorded in the transcript as a tool_call item with a tool_status.
How do I test a voice AI webhook locally?
Expose your server with a tunnel such as ngrok, or point the webhook at a request catcher such as webhook.site. A webhook URL must use https and point at a public host, so localhost is refused. Calls from the dashboard browser tester do not send webhooks, so place a real test call.
What happens if my webhook endpoint is down?
A timeout, network error or 5xx is retried 1, 5, 15, 30 and then 60 minutes after the previous failure, 6 attempts in all. A 4xx is final. After the last attempt the delivery is dropped, and you can still read the call with GET /v1/calls/{call_id}.
Are voice AI webhook payloads signed?
No. Payloads are not signed, so the URL is the credential. Serve it over https, put an unguessable token in the path, reject requests without it, and optionally confirm a payload by fetching GET /v1/calls/{call_id}.
Can I send voice AI call results to my CRM without code?
Yes. Connect the call events to your CRM or calendar through no-code flows in Integrations, or send the webhook to any tool that accepts one. Write code only when you need custom logic around the payload.
See it on your own numbers
AI calls from $0.25/min, priced by the destination country's zone. No seat fees for AI calling and no setup fees for self-serve AI calling.