Receive webhooks
Receive call and campaign events at your own HTTPS endpoint.
Webhooks notify your server when a call ends, when a recording is available, and when a
campaign completes. Resonera sends each event as an HTTPS POST request to the webhook
endpoints you register.
Before you begin
- An API key with the
webhooks:managescope. - A public HTTPS URL. URLs on private networks are rejected.
Events
| Event | Sent when | data |
|---|---|---|
call.ended | A call ends, whether or not it connected. | The call object, as returned by GET /calls, including contact.extra. |
call.recording_ready | The call's recording is available, usually within one minute of call.ended. | The call object, with has_recording: true. |
campaign.completed | Every contact in a campaign has been called. | The campaign object, as returned by GET /campaigns/{campaign_id}, including contacts_by_status. |
Events do not include transcripts. Retrieve a transcript with GET /calls/{call_id}.
Register an endpoint
Create the endpoint
curl -X POST https://api.resonera.ai/v1/webhooks/endpoints \
-H "X-API-Key: $RESONERA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://crm.example.com/resonera/webhook", "events": ["call.ended"]}'Omit events to subscribe to all events. The response includes the endpoint's signing
secret (whsec_...). Store it securely. It is shown only once.
Send a test event
curl -X POST https://api.resonera.ai/v1/webhooks/endpoints/$ENDPOINT_ID/test \
-H "X-API-Key: $RESONERA_API_KEY"Your endpoint receives a ping event. To check the result, call
GET /webhooks/endpoints/{endpoint_id}/deliveries.
Event payload
Each event is a POST request with a JSON body:
{
"id": "evt_7b74f0680dbb4562b2ca6d6a526fa1cd",
"type": "call.ended",
"created_at": "2026-10-05T09:14:13.412Z",
"data": {
"call_id": "88433d99-ead1-4ee2-86c1-7a2cbfd6d064",
"campaign_id": "3f1d9a52-7c0e-4b8a-a1f3-5e2c9d8b7a64",
"agent_id": "8b8e3307-2c1a-4f6e-9a51-0d7c2b9e4f10",
"agent_name": "Neha",
"direction": "outbound",
"phone_number": "+919876543210",
"status": "completed",
"end_reason": "completed",
"outcome": "requirements_gathered",
"summary": "Wants a demo on Friday afternoon.",
"error": null,
"duration_seconds": 93.2,
"start_time": "2026-10-05T09:12:40+00:00",
"end_time": "2026-10-05T09:14:13+00:00",
"has_recording": false,
"contact": { "name": "Asha", "extra": { "crm_id": "42" } }
}
}| Header | Description |
|---|---|
Resonera-Event-Id | The event's id. Identical across retries of the same event. |
Resonera-Event-Type | The event's type. |
Resonera-Signature | t=<unix timestamp>,v1=<HMAC-SHA256 hex digest>. See Verify signatures. |
Verify signatures
Verify the signature of every event before processing it. The signature is an HMAC-SHA256 of the timestamp, a period, and the raw request body, using the endpoint's secret as the key:
v1 = hex(HMAC_SHA256(secret, t + "." + raw_body))Compare signatures in constant time, and reject timestamps older than five minutes to prevent replay attacks.
Compute the signature over the raw request body. Parsing and re-serializing the JSON changes the bytes, and the signature no longer matches.
import hashlib
import hmac
import os
import time
from flask import Flask, abort, request
SECRET = os.environ["RESONERA_WEBHOOK_SECRET"].encode()
app = Flask(__name__)
def verify(raw_body: bytes, header: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t, v1 = parts.get("t", ""), parts.get("v1", "")
if not t.isdigit() or abs(time.time() - int(t)) > 300:
return False
expected = hmac.new(SECRET, f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, v1)
@app.post("/resonera/webhook")
def webhook():
if not verify(request.get_data(), request.headers.get("Resonera-Signature", "")):
abort(400)
event = request.get_json()
if event["type"] == "call.ended":
save_call(event["data"])
return "", 204Respond to events
Return a 2xx status code within 10 seconds. Process long-running work, such as CRM updates,
asynchronously after you respond.
Resonera retries a delivery that returns any other status, times out, or cannot connect. Retries follow this schedule:
| Attempt | Delay after the previous attempt |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 5 hours |
| 7 | 10 hours |
| 8 | 18 hours |
After the eighth attempt, the delivery is marked failed. Redirects are not followed. Register
the final URL.
GET /webhooks/endpoints/{endpoint_id}/deliveries returns each delivery's status, attempt
count, last response code, and next retry time.
Handle duplicate and out-of-order events
An event can be delivered more than once, for example when your server processes a request but
times out before responding. Use the Resonera-Event-Id header to skip events you have already
processed.
Events can arrive out of order, particularly after retries. In rare cases, call.recording_ready
arrives before call.ended. Use the timestamps in data, and treat each event as an update to
the record.
Manage endpoints
| Task | Request |
|---|---|
| Pause deliveries | PATCH /webhooks/endpoints/{endpoint_id} with {"enabled": false}. Events that occur while an endpoint is paused are not delivered later. |
| Rotate the signing secret | POST /webhooks/endpoints/{endpoint_id}/rotate-secret. Events signed after rotation use the new secret. |
| Delete an endpoint | DELETE /webhooks/endpoints/{endpoint_id}. Pending retries are canceled. |
Each account can have up to 10 webhook endpoints.