Developers

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

TopicSummary
DeliveryCalleague sends a JSON POST to a web address you host.
TransportSecure connection only; your endpoint should reply 2xx quickly.
AuthEach delivery carries your key as a Bearer token.
SelectionYou choose which events you want.
ReliabilityA failed delivery is retried with a growing wait.
OrderingTreat 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 $TOKEN

Events you can receive

EventFires whenKey fields
call.startedA call is placed or received.callId, agentId, direction
call.connectedThe call connects and audio begins.callId, connectedAt
call.completedThe call finishes normally.callId, durationSec, endedReason
call.failedThe call could not connect or errored.callId, endedReason
recording.readyA recording is processed and available.callId, recordingId
transcript.readyA 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 OK

Verification

StepWhy
Check the Authorization: Bearer tokenConfirms the delivery is from Calleague, not an impostor.
Require a secure connection on your endpointProtects the payload and token in transit.
Check event against the list you subscribed toIgnore 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 (or callId + event) and treat a repeat as a no-op.
  • Acknowledge first, work later. Reply 2xx straight 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

SymptomLikely causeFix
No deliveries arriveAddress not registered, or no matching eventsRe-check the registered url and events list
The same event is processed twiceHandler isn't repeatableDe-duplicate on deliveryId
Deliveries keep retryingEndpoint returns non-2xx or times outReply 2xx fast; move slow work to a queue
Payload rejected as untrustedBearer token mismatchCompare against your active key; replace if leaked
A field you expect is missingOptional/new field absent for this eventCheck it exists first; don't require optional fields
Events arrive out of orderNormal under retriesOrder by occurredAt, not by arrival time

Webhooks vs. REST

You want to…Use
React the moment a call event happensA webhook subscription
Read past calls or assistants on demandThe REST API
Catch up after downtimeRead the REST API for the window you missed

FAQ

Next steps