Contact
Log inBook a Call
Book a Call

Leads are waiting for you.
Get them now.

See how TopCalls can qualify leads, follow up faster, and keep improving the calling motion over time.

Book a Call

Product

  • AI Voice Agents
  • Smart Campaigns
  • Inbound AI Calls
  • Analytics
  • Integrations
  • Voice Cloning
  • Browser Dialer
  • Phone Numbers
  • MCP server
  • CLI

Solutions

  • Lead Qualification
  • Appointment Setting
  • Customer Reactivation
  • Follow-up Automation
  • Sales Acceleration
  • Recruitment Screening
  • Multi-language Support

Resources

  • Blog
  • Resource Library
  • Compare
  • Switch to Topcalls
  • Use Cases
  • FAQ
  • ROI Calculator
  • Glossary
  • Benchmarks
  • How-to Guides
  • Brand Kit
  • Documentation

Assistance

  • Help center
  • Support

More

  • Pricing
  • Changelog
  • Careers

Socials

© 2026 TopCalls.ai. All rights reserved.

Privacy PolicyTerms of ServiceEULACookie PolicyCancellation PolicyDPA
← Back to Blog/Sales Automation
Sales Automation

Voice AI Webhooks, APIs and Function Calling Explained

Teodor AvadaniTeodor Avadani, Founder·
Jun 28, 2026·14 min read·Last updated: Nov 17, 2026
Cover Image for Voice AI Webhooks, APIs and Function Calling Explained

When a call ends, your AI voice agent should hand the result to your own systems without anyone copying it over. That is the job of AI voice agent webhooks and APIs: Topcalls sends a JSON message to your server after every call, your software can start and control calls through the REST API, and the agent itself can call tools in the middle of a conversation. This guide shows what each of the three does, what really arrives, and where the limits are.

Key Takeaways

  • A Topcalls webhook is one JSON POST per call, sent when the call ends, with the transcript, recording link, summary, outcome and any data the agent collected.
  • Webhooks go out at least 15 seconds after hang-up, because the transcript, summary and recording have to be ready first. Failed and cancelled calls are sent immediately.
  • Webhook payloads are not signed, so you protect the endpoint with HTTPS and an unguessable token in the URL, then check the call through the API if it matters.
  • Function calling lets the agent run tools mid-call. A tool has 8 seconds to answer by default, and a live call never waits longer than 9.
  • Custom tools are flows you build in Topcalls Integrations and select per campaign, so the agent only gets the tools that campaign lists.
  • The REST API and webhooks add no charge of their own. AI calls start from $0.25/min, set by the country you call.

What are AI voice agent webhooks?

AI voice agent webhooks are messages your calling platform sends to a web address you own when a call event happens. Instead of your software asking Topcalls "any new calls?" every minute, Topcalls pushes the result to you. Each message is a single HTTP POST with a JSON body that your server catches and acts on.

The difference is push versus poll. Polling wastes requests and adds delay, while a webhook arrives right after the call result is ready. If you would rather not run a server at all, the no-code integration builder covers the same ground, and the complete guide to AI voice agent integrations walks through the connection methods.

How does voice AI integrate with APIs and webhooks?

Voice AI connects to your software in three directions. Webhooks push call results from Topcalls to your server. The REST API lets your software push instructions the other way: start a call, manage leads, run a campaign. Function calling lets the agent itself reach out to a tool while the caller is still on the line.

All three can run side by side. A common setup uses the no-code builder for the easy 80%, a webhook for the custom last mile, and the API to launch campaigns from your own CRM or app.

What call events can fire a webhook?

Topcalls fires one event for every call that ends: call.completed. That includes failed and cancelled calls, so every payload carries a status of completed, failed or cancelled and one endpoint can handle all three. To listen for one outcome only, add the disposition to the event name, for example call.completed.booked_callback.

  • call.completed: fires for any call that ends, including voicemails, no-answers and failures. The catch-all most teams listen to.
  • call.completed.<disposition>: fires when the call ends with that outcome, such as a booked callback, a transfer or a voicemail. The disposition is the outcome label turned into a lowercase slug.
  • Filters: narrow a subscription further by direction, phone number pattern or conversion. The is_conversion filter matches calls whose outcome is one of your campaign's conversion outcomes.

You can set a webhook in three places: on a single call with webhook_url, on a campaign, or as an account-level subscription created through the API, which receives every matching call however it was created. Calls made with the browser tester never send webhooks. Other event names such as lead.status_changed pass validation today but nothing sends them, so do not subscribe to them. The Topcalls webhook guide keeps the current list.

Developer workspace with call event webhook code on screen
Photo by Jakub Żerdzicki on Unsplash

What's in a call webhook payload?

A completed call sends the call id, both phone numbers, the direction, the status, the duration in minutes, the full transcript, a recording link, the summary, the outcome label and whether it counts as a conversion. The analysis field carries the outcome label and the main objection, and any metadata you attached when you created the call comes back unchanged.

FieldTypeWhat it holds
call_idstringThe id to deduplicate on, and to look the call up with GET /v1/calls/{call_id}
phone_numberstringThe other party. The same for outbound and inbound calls
from_phone_numberstringThe number on your side of the call
directionstringoutbound when Topcalls placed the call, inbound when it came in on one of your numbers
statusstringcompleted, failed or cancelled
call_statusstringThe telephony outcome, such as completed, no-answer or busy
durationnumberCall length in minutes
transcriptarrayEvery turn, plus items for tool calls, handoffs, signals, barge-ins and how the call ended
recording_urlstringLink to the recording. Left out if the recording was not ready in time, and never added later
call_summarystringShort summary of the conversation
error_messagestring or nullnull in the docs example
answered_bystringWho picked up. The docs example shows human
campaign_id, lead_idstringThe campaign and the lead the call belongs to
created_at, started_at, end_atstringCall timestamps in ISO 8601 format
dispositionstringThe outcome label from post-call analysis, or a platform label: Voicemail, Transferred or No Response
is_conversionbooleantrue when the disposition is one of the campaign's conversion outcomes. Always false on failed calls
analysisobjectcall_outcome and main_objection
metadataobjectWhatever you attached when you created the call, returned unchanged
caller_namestring or nullInbound payloads only: the name the caller's network sent
transferred_to, transfer_statusstringPresent when the agent tried a transfer to a person
Call webhook payload fields, checked against docs.topcalls.ai on 17 November 2026

The transcript is more than speech. When the agent used a tool, the transcript holds a tool_call item with the tool name and whether it succeeded, failed or is unknown. That is how you see function calling in your own logs. Spoken turns have no kind, so skipping items that have one leaves you with the plain conversation.

Timing matters for your design. The webhook goes out once the transcript, summary and recording are ready, at least 15 seconds after hang-up, and it waits up to about two and a half minutes for the recording. If the recording still is not ready, the webhook goes without recording_url, and nothing adds it later. Build your handler so a missing recording does not break the flow.

How do webhooks and function calling work in voice AI agents?

Webhooks report what happened after the call. Function calling changes what happens during it. With function calling, the agent decides mid-conversation to run a tool, the platform runs it with the arguments the agent chose, and the result goes back to the agent, which works it into its next reply. Webhooks are one-way and late. Function calls are two-way and live.

Here is the shape of a tool call in practice:

  • The caller asks: "Can you check if 3 PM tomorrow is available?"
  • The agent decides: it picks a tool such as a calendar check, based on the tool's description and the question.
  • The tool runs: the platform calls it and returns something like {"available": true}.
  • The agent answers: "Yes, 3 PM tomorrow is open. Want me to book it?"

Every Topcalls call has a built-in end_call tool for wrapping up, and a campaign with transfer targets can also hand the caller to a person. Anything custom is a flow you build in Topcalls Integrations, such as "book a callback in my calendar" or "send an SMS confirmation", and then select as a tool in the campaign editor. The function calling guide documents the details.

Two limits are worth knowing before you design around it. A tool has 8 seconds to answer by default, and a live call never waits longer than 9, so a slow tool can leave the line quiet. And tools reach calls only through a campaign: a call placed directly with the create-call API gets end_call and nothing else. Keep tool answers under 2 seconds if you can, validate arguments on your side, and select only the tools a campaign needs.

What can you do with the Topcalls REST API?

The REST API flips the direction of a webhook. Instead of Topcalls pushing to you, your software calls Topcalls to make things happen. It covers calls, campaigns, leads, phone numbers, knowledge base entries, webhook subscriptions and account balance, and each endpoint lists the permission scope it needs.

  • Start and control calls: place a call now or at a scheduled time with a task or full instructions, or stop one that is queued or live.
  • Manage leads at scale: create lists and leads, update or delete them, and bulk-import up to 2,000 leads in one request. A failed import writes nothing.
  • Run campaigns: create, start, pause, resume or stop a campaign without opening the dashboard.
  • Pull call records: list calls newest first with transcript, recording, summary and billed minutes.
  • Check the meter: read your credit balance and quote what a minute to a number would cost before you place the call.

Teams that already sync a CRM usually pair the API with an existing pipeline. The AI dialer CRM integration guide shows how call data lands in Salesforce, HubSpot or Pipedrive, and the API is how you wire the same data into a custom system. If you work from an AI chat app instead of code, the Topcalls MCP server exposes the same account to Claude, ChatGPT and your terminal.

API dashboard streaming real-time AI call data into a custom application

Want to see what faster call data is worth to your pipeline? Run the numbers in the ROI calculator before you write a line of code.

Webhooks, the builder, or the API: which to use?

Pick by direction and by who sets it up. The no-code integration builder connects call events to ready-made apps, and anyone can set it up in the app. Webhooks push call results into your own database or app and need a developer. The REST API runs the other way and also needs a developer. Most teams need only the builder.

ApproachDirectionBest forWho sets it up
No-code integration builderTopcalls to your appsConnecting call events to ready-made appsAnyone, in the app
WebhooksTopcalls to your serverPushing call results into your own database or appA developer
REST APIYou to TopcallsStarting calls and managing data from codeA developer
Function callingAgent to your tools, liveLooking things up or acting during the callAnyone who can build an Integrations flow
Webhooks, the integration builder, the REST API and function calling compared

The post-call workflow guide covers the builder side in more detail, and the Topcalls integrations page lists what it connects to.

Which voice AI platforms offer webhooks and event streaming for call data?

Retell, Vapi, Bland and Synthflow all send webhooks with call data, and Retell and Vapi also stream live call events over a WebSocket while the call is running. Topcalls sends one webhook when each call ends, plus optional events for a single outcome, and its docs describe no live stream. We checked each vendor's own docs on 15 November 2026.

PlatformWebhook eventsWebhook authenticationLive event stream
Topcallscall.completed for every ended call, plus call.completed.<disposition> for one outcomeNone. The webhook URL is the credentialNone documented. Data arrives when the call ends
Retellcall_started, call_ended and call_analyzed, plus transcript_updated and transfer eventsYes, a signature in the X-Retell-Signature headerYes. A monitor WebSocket streams the live transcript, tool calls and node transitions
VapiServer messages posted to your server URL: status updates, transcripts, function calls and end-of-call reportsAuthentication with credentials you configureYes. A call's listenUrl streams live audio and events over a listen-only WebSocket
BlandPost-call webhooks with the transcript and extracted dataYes, an HMAC SHA-256 signature in the X-Webhook-Signature headerA WebSocket for the transcript after a transfer to a person, and an API endpoint that lists a call's events
SynthflowA post-call webhook and an inbound-call webhookYes, HMAC signature verificationWebSocket audio streaming for embeds. No live call-event stream found
Webhooks and live event streaming by voice AI platform, checked 15 November 2026

Pages read: Topcalls webhook guide. Retell webhook overview, secure webhooks and monitor call WebSocket. Vapi server events and call listen. Bland post-call webhooks, webhook signing and transcript stream. Synthflow webhooks overview. A gap means we found nothing on those pages, and vendors change them, so read them again before you buy.

Function calling differs too. Vapi sends a tool-calls message to your server URL and waits for your answer, while Topcalls runs the tools you build as Integrations flows and selects them per campaign.

A live stream lets you page a human or update a screen while the call is still running. A post-call webhook is enough when the next step happens after hang-up, such as a CRM update, a follow-up task or a report. Check this table against the point in the call where your own code needs the data, and use our questions to ask a voice AI vendor for the rest of the shortlist.

Voice AI webhook reference: events, payload, tool calls and retries

Topcalls sends one JSON POST to your server when each call ends. The event is call.completed, with an optional outcome suffix. Payloads are not signed, so the webhook URL is the credential. A failed delivery is retried five times over 111 minutes and then dropped, and the call stays available through the REST API. Everything below comes from docs.topcalls.ai, checked on 17 November 2026.

Which webhook events does Topcalls send?

Two event names fire today, and one more channel sends the same payload without an event name. Every one of them carries the full call payload shown in the next section.

Event or channelWhen it firesPayload fieldsDocs page
call.completedAny call ends: completed, failed or cancelled. Failed and cancelled calls go out right away. Completed calls go out at least 15 seconds after hang-up, once the transcript, summary and recording are readyThe full call payloadconcepts/webhooks
call.completed.<disposition>A call ends with that disposition. The suffix is the label lowercased, with each run of other characters replaced by _, so Booked Callback becomes call.completed.booked_callback. Platform labels are transferred, voicemail and no_responseThe full call payloadconcepts/webhooks
webhook_url on a call or a campaignEvery call that URL is set on. webhook_call_status_filter narrows it by the telephony outcome, such as completed, no-answer or busyThe full call payloadguides/webhooks
lead.status_changed, campaign.activated, campaign.pausedNever. They pass validation, but nothing sends them. Do not subscribe to themNoneconcepts/webhooks
Topcalls webhook events and when they fire, checked against docs.topcalls.ai on 17 November 2026

What does a call-ended webhook payload look like?

This is the complete call.completed payload from the Topcalls docs. duration is in minutes, and status is completed, failed or cancelled. The field table above explains each key.

call.completed payload (docs.topcalls.ai/guides/webhooks)
{
  "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": "2025-12-22T10:30:05.120Z"
    },
    {
      "id": 2,
      "role": "user",
      "text": "Yes, hi...",
      "created_at": "2025-12-22T10:30:08.450Z"
    },
    {
      "id": 3,
      "role": "assistant",
      "text": "",
      "created_at": "2025-12-22T10:32:35.010Z",
      "kind": "end",
      "end_via": "caller"
    }
  ],
  "recording_url": "https://s3.topcalls.ai/2025/12/22/7f3e9a52-1c4b-4d8e-9a6f-2b5c8d1e0f34.mp3",
  "call_summary": "Successfully confirmed appointment...",
  "error_message": null,
  "answered_by": "human",
  "campaign_id": "camp_abc123",
  "lead_id": "lead_xyz789",
  "created_at": "2025-12-22T10:30:00Z",
  "started_at": "2025-12-22T10:30:05Z",
  "end_at": "2025-12-22T10:32:35Z",
  "disposition": "Appointment Booked",
  "is_conversion": true,
  "analysis": {
    "call_outcome": "Appointment Booked",
    "main_objection": null
  },
  "metadata": {
    "patient_id": "pat_123",
    "source": "reminder_system"
  }
}

How do you subscribe to webhooks through the API?

An account-level subscription receives every matching call on your account, however the call was created. Create one with POST /v1/webhooks. Add filters to narrow it: every key has to match, a plain value matches by equality, an array matches any of its strings, and a string with % is a SQL LIKE pattern of at most 256 characters.

Create a subscription
curl -X POST https://api.topcalls.ai/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "call.completed",
    "url": "https://hooks.your-app.com/topcalls"
  }'
Conversions on numbers that start with +1555
{
  "event": "call.completed",
  "url": "https://hooks.your-app.com/conversions",
  "filters": {
    "is_conversion": true,
    "phone_number": "+1555%"
  }
}

GET /v1/webhooks lists your subscriptions, and GET, PATCH and DELETE on /v1/webhooks/{webhook_id} read, change or remove one. The full schemas are in the Topcalls API reference.

How does function calling work in a Topcalls call?

In Topcalls a custom tool is a flow you build in Integrations, so you do not write a tool schema. You select the flow in the campaign editor, or list its name in the campaign config.mcp_tool_allowlist. The agent gets only the tools its campaign lists. A call placed with POST /v1/calls gets no Integrations tools, only end_call.

POST /v1/campaigns, the tool part of the body
{
  "name": "Front desk",
  "config": {
    "mcp_tool_allowlist": ["book_appointment", "send_pricing_link"]
  }
}

During the call the agent picks a tool from its description and the question, the platform runs it with the arguments the agent chose, and the result goes back into the agent's next reply. This is the trace the docs use:

One tool call, as the docs describe it
Caller: "Can you check if 3 PM tomorrow is available?"

Agent: [calls check_availability with date and time]
    -> Tool returns: {"available": true}

Agent: "Yes, 3 PM tomorrow is open. Want me to book it?"

After the call, the webhook transcript shows each tool use as an item with a kind of tool_call. It holds the tool name and a status of success, failure or unknown, and it does not hold the arguments or the result, so log those on your own tool server. tool_ok is false only on a reported failure and does not prove that the action worked. The values below are illustrative; the keys are the real ones.

A tool_call item in the webhook transcript
{
  "id": 3,
  "role": "assistant",
  "text": "",
  "created_at": "2025-12-22T10:31:10.000Z",
  "kind": "tool_call",
  "tool_name": "check_availability",
  "tool_status": "success",
  "tool_ok": true
}
LimitValueDocs page
Time a tool has to answer8 seconds by default. A Live call never waits longer than 9. A slow tool can leave the line quietguides/function-calling
Recommended tool answer timeUnder 2 seconds if you canguides/function-calling
Tools on a call placed with POST /v1/callsend_call only. Integrations tools reach calls only through a campaignguides/function-calling
When a tool fails or times outThe agent is told and carries on, for example by offering to take a preferred time and have someone confirm itguides/function-calling
Tools per campaignFive to ten works well. Select only what the campaign needsguides/function-calling
Function calling limits, checked against docs.topcalls.ai on 17 November 2026

What are the webhook retry and signature rules?

Topcalls does not sign webhook payloads, and it retries only the failures that can be temporary. Build the handler around the table below, and acknowledge before you do any slow work.

RuleWhat Topcalls doesDocs page
RequestA JSON POST with Content-Type application/jsonguides/webhooks
SignatureNone. Payloads are not signed, so the URL is the credential. Use HTTPS, put an unguessable token in the path or query string and reject requests without it. To check a payload, fetch GET /v1/calls/{call_id} and compareguides/webhooks
URL ruleshttps only, on a public host. Private and local addresses, localhost included, are refusedguides/webhooks
Response deadline10 seconds to answer with a 2xxconcepts/webhooks
A 4xx answerFinal. Never retriedconcepts/webhooks
RedirectsUp to 3, each to another https URL on a public host. A longer chain, or a redirect to a private address, is final. A 303 counts as delivered and is not followedguides/webhooks
Timeout, network error or 5xxRetried 1, 5, 15, 30 and then 60 minutes after the previous failure: 6 attempts in allconcepts/webhooks
After the last failed attemptThe delivery is dropped. The call is still in GET /v1/calls/{call_id}concepts/webhooks
DuplicatesThe same call can arrive more than once. Deduplicate on call_idguides/webhooks
Missing recordingAfter about 2.5 minutes the webhook goes without recording_url, and nothing adds it laterguides/webhooks
Topcalls webhook delivery rules, checked against docs.topcalls.ai on 17 November 2026

The docs example for a handler that acknowledges first looks like this:

Express handler, from docs.topcalls.ai/guides/webhooks
app.post('/webhooks/call-complete', async (req, res) => {
  // Acknowledge first, then do the slow work
  res.status(200).json({ received: true });

  const call = req.body;
  await updateCRM(call);
  await sendNotification(call);
  await updateAnalytics(call);
});

Browser tester calls never send webhooks. For the full reference, read the Topcalls webhook guide, the webhooks and events page and the function calling guide. If you need post-call actions without code, start with post-call workflow automation and the Topcalls integrations.

How do you secure and test a webhook?

Topcalls webhook payloads are not signed, so the URL itself is the credential. Serve the endpoint over HTTPS only, put an unguessable token in the path or query string and reject requests that lack it, and keep the URL out of public logs and repositories. If you need to be sure about a payload before acting on it, fetch the same call from the API by its id and compare.

  • Use a public HTTPS address: a webhook URL must use https and point at a public host. Private addresses, including localhost, are refused, so use a tunnel such as ngrok while testing.
  • Answer fast, then work: your endpoint has 10 seconds to return a 2xx. Reply first and do the heavy lifting in the background.
  • Expect duplicates: retries can deliver the same call more than once, so deduplicate on call_id.
  • Know the retry rules: a 4xx answer is final and never retried. A timeout or 5xx is retried after 1, 5, 15, 30 and then 60 minutes, six attempts in all. After that the delivery is dropped, but the call is still available through the API.
  • Test with a throwaway endpoint: point the webhook at webhook.site first, read a real payload, then build against its actual shape.

Recordings and transcripts are personal data once they leave Topcalls, so the same care applies to the system that receives them. TCPA, GDPR and do-not-call compliance stays with you. Topcalls never dials a number on your account's Block list, and POST /v1/block-list lets your systems add opt-outs to it. For how long to keep them, see our guide to voice AI call recording retention.

Where are webhooks the wrong tool?

Webhooks are the wrong tool for most teams. If all you need is to post a Slack message, add a HubSpot contact or log a row in a spreadsheet, the no-code builder does that in minutes with no server to run and nothing to maintain.

Reach for a webhook or the API only when you own software that no connector touches: a proprietary database, an internal tool, a bespoke billing flow. Reach for function calling when the caller needs a live answer from your system during the call, and when a tool built in Integrations can supply it. For everything else, start with post-call automations and drop to code only where you have to.

How do you get started?

Create an account and add credit to try a campaign yourself, or book a call and the team will map webhooks, the API and function calling to your stack. AI calls start from $0.25/min depending on the country you call, billed by the second, and the REST API and webhooks add nothing to that. Size the upside first with the ROI calculator, then see how AI voice agents and appointment setting fit your funnel, or talk to the team about your integration.

Frequently Asked Questions

Get AI calling tips in your inbox

No spam. One email per week with actionable sales automation tips.

Table of Contents

  • Key Takeaways
  • What are AI voice agent webhooks?
  • How does voice AI integrate with APIs and webhooks?
  • What call events can fire a webhook?
  • What's in a call webhook payload?
  • How do webhooks and function calling work in voice AI agents?
  • What can you do with the Topcalls REST API?
  • Webhooks, the builder, or the API: which to use?
  • Which voice AI platforms offer webhooks and event streaming for call data?
  • Voice AI webhook reference: events, payload, tool calls and retries
  • Which webhook events does Topcalls send?
  • What does a call-ended webhook payload look like?
  • How do you subscribe to webhooks through the API?
  • How does function calling work in a Topcalls call?
  • What are the webhook retry and signature rules?
  • How do you secure and test a webhook?
  • Where are webhooks the wrong tool?
  • How do you get started?

Share this article

XLinkedIn

Summarize with AI

ChatGPTPerplexityGemini

Ready to automate your calls?

Book a 30-min call or calculate your ROI.

Book a CallROI Calculator

Share this article

XLinkedIn

Summarize with AI

ChatGPTPerplexityGemini

Ready to automate your calls?

Book a 30-min call or calculate your ROI.

Book a CallROI Calculator

Related Articles

How to Integrate an AI Sales Dialer With HubSpot, Salesforce, and Pipedrive

How to Integrate an AI Sales Dialer With HubSpot, Salesforce, and Pipedrive

AI dialer HubSpot integration step by step: connect TopCalls to HubSpot, Salesforce and Pipedrive, sync call outcomes and automate follow-ups.

Nov 25, 2025

Post-Call Automation: Triggers and Workflows Without Code

Post-Call Automation: Triggers and Workflows Without Code

Post-call automation sends every AI call outcome to your CRM, Slack and email without code. The 7 triggers, a trigger-action-system table and the run limits.

Jun 30, 2026

AI Voice Agent Integrations: Native vs Workaround (2026)

AI Voice Agent Integrations: Native vs Workaround (2026)

Which AI voice agent platforms connect natively to calendars, CRMs and webhooks? See what Topcalls does out of the box and where an API step is needed.

Jul 1, 2026