Webhooks & events
Subscribe to Calleague call-lifecycle events and react in real time — register a webhook, read the events table, handle the payload, and cope with retries and verification.
Calleague can tell your own systems what's happening as calls play out. Instead of constantly asking the REST API "is it done yet?", you subscribe to call-lifecycle events and get a message the moment a call starts, connects, finishes, or a recording or transcript becomes available. This page covers how to register a webhook, the events you can receive, the payload shape, verification, and retries.
At a glance
| Topic | Summary |
|---|---|
| Delivery | Calleague sends a JSON POST to a web address you host. |
| Transport | Secure connection only; your endpoint should reply 2xx quickly. |
| Auth | Each delivery carries your key as a Bearer token. |
| Selection | You choose which events you want. |
| Reliability | A failed delivery is retried with a growing wait. |
| Ordering | Treat events as unordered; match on callId + the event name. |
How it works
A webhook is a web address your service hosts. You register that address with Calleague and pick the events you care about; Calleague then sends a JSON POST to it whenever a matching event fires.
Build an endpoint
Stand up a route in your own app that accepts a POST with a JSON body, over a secure connection. Reply 2xx immediately, then do any slow work afterwards.
You'll see Calleague's deliveries arrive at this address once it's registered.
Register it
Register the address and the events you want — from the integrations area of the app, or with one request. The body lists the url to call and the events to send.
curl -s -X POST https://app.calleague.ai/api/core/webhook \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.example.com/hooks/calleague",
"events": ["call.started", "call.completed", "recording.ready"]
}'You'll get back a webhook record you can update or remove later.
Verify each delivery
Confirm the incoming Authorization: Bearer token matches your key before you trust the body, then reply 2xx.
You'll see retries stop once you acknowledge with a 2xx.
Every delivery carries your API key, so you can confirm it really came from Calleague:
Authorization: Bearer $TOKENEvents you can receive
| Event | Fires when | Key fields |
|---|---|---|
call.started | A call is placed or received. | callId, agentId, direction |
call.connected | The call connects and audio begins. | callId, connectedAt |
call.completed | The call finishes normally. | callId, durationSec, endedReason |
call.failed | The call could not connect or errored. | callId, endedReason |
recording.ready | A recording is processed and available. | callId, recordingId |
transcript.ready | A transcript is processed and available. | callId, transcriptId |
The event names and fields here describe the shape of the integration, not a frozen list. Build against the events your account actually delivers, and ignore fields you do not recognise so new ones can be added safely.
Example payload
When a subscribed event fires, Calleague sends JSON to your endpoint:
{
"event": "call.completed",
"deliveryId": "dl_4c19",
"occurredAt": "2026-01-01T12:01:24.000Z",
"data": {
"callId": "cl_8f2a",
"agentId": "ag_123",
"direction": "inbound",
"durationSec": 84,
"endedReason": "completed",
"language": "tr",
"metadata": { "orderId": "A-1042" }
}
}The metadata you passed when starting the call is echoed back here, so you can match the event to your own record without a second lookup.
Reply fast — your endpoint should acknowledge before doing slow work:
HTTP/1.1 200 OKVerification
| Step | Why |
|---|---|
Check the Authorization: Bearer token | Confirms the delivery is from Calleague, not an impostor. |
| Require a secure connection on your endpoint | Protects the payload and token in transit. |
Check event against the list you subscribed to | Ignore event types you didn't ask for. |
De-duplicate on deliveryId (or callId + event) | The same delivery may arrive more than once. |
Never act on a webhook you cannot verify. If the Bearer token doesn't match your key, reply 2xx to stop retries but discard the body — and replace your key if you think it leaked.
Retries & reliability
If your endpoint doesn't reply 2xx (it errors, times out, or is unreachable), Calleague retries the delivery with a growing wait for a limited window. To stay correct under retries:
- Be repeatable. Key your processing on
deliveryId(orcallId+ event) and treat a repeat as a no-op. - Acknowledge first, work later. Reply
2xxstraight away, then queue the slow work. - Don't block. A slow handler causes timeouts, which trigger more retries.
- Tolerate out-of-order delivery. A retry of an earlier event can land after a later one.
If something looks different
| Symptom | Likely cause | Fix |
|---|---|---|
| No deliveries arrive | Address not registered, or no matching events | Re-check the registered url and events list |
| The same event is processed twice | Handler isn't repeatable | De-duplicate on deliveryId |
| Deliveries keep retrying | Endpoint returns non-2xx or times out | Reply 2xx fast; move slow work to a queue |
| Payload rejected as untrusted | Bearer token mismatch | Compare against your active key; replace if leaked |
| A field you expect is missing | Optional/new field absent for this event | Check it exists first; don't require optional fields |
| Events arrive out of order | Normal under retries | Order by occurredAt, not by arrival time |
Webhooks vs. REST
| You want to… | Use |
|---|---|
| React the moment a call event happens | A webhook subscription |
| Read past calls or assistants on demand | The REST API |
| Catch up after downtime | Read the REST API for the window you missed |
FAQ
Next steps
REST API
Call the Calleague app API with a Bearer token — start a call, look it up, read assistants, paginate lists, and handle errors and rate limits. With the real worked example from the screenshot.
MCP
Connect Calleague to Model Context Protocol clients — let an assistant discover and call your tools mid-conversation, or expose Calleague capabilities to MCP-capable clients.