Webhooks
Webhooks
Vaakyo posts each event of every call to your server as it happens, signed with a secret only you and Vaakyo know. Delivery happens outside the call, so a slow or broken endpoint never affects a live call.
Where events go
| Target | Set up with | Receives | Signed with |
|---|---|---|---|
| Workspace endpoints | Webhooks in the console | The event types it subscribes to, for every call in the workspace | The endpoint’s own secret |
An agent’s webhook_url | The agent’s Webhook & number tab | The lifecycle events of that agent’s calls | The workspace’s default secret |
A campaign’s webhook_url | Webhook settings when you create a campaign | The lifecycle events of that campaign’s calls | The workspace’s default secret |
All of them can be set. An event goes to every matching target.
Delivery runs in the background: Vaakyo saves each delivery and dispatches it asynchronously. Your endpoint’s speed never changes how the call sounds.
Register an endpoint
Add endpoints in the console under Webhooks (owners, admins and roles with the keys.manage permission). Endpoints are managed in the console only; they are not part of the REST API.
| Field | Default | Rules |
|---|---|---|
| URL | required | https, on the public internet: private, loopback, link-local and cloud-metadata addresses are refused when you save it and again on every delivery (a delivery to a host that resolves to one fails). Redirects are not followed. Up to 500 characters. |
| Description | empty | Up to 200 characters. |
| Events | the call lifecycle | The call lifecycle (call.queued, call.placed, call.started, call.ended, call.completed), or a list of event types from Webhook events. An endpoint can also list any of crm.updated, call.voicemail, call.rescheduled, call.transferred, call.transfer_status, tool.call, error and guardrail.violation. Other timeline events (such as user.turn) are never sent to webhooks. |
| Active | on | An inactive endpoint gets nothing. |
The endpoint’s signing secret (whsec_...) is shown once, when you add it; store it then. Later the console shows only a hint. A workspace can have up to 20 endpoints.
From the same page you can change, pause or delete an endpoint, and Send test posts one ping event straight away and shows your server’s response.
The request
Every delivery is a POST with a JSON body:
{
"id": "evt_7d0c6f0f2b8e4b0a9c1e3f5a7b9d1e3f",
"type": "tool.call",
"created_at": "2026-10-01T09:15:04.512000+00:00",
"workspace_id": "6df74233a1b04c2e9f8d7c6b5a4e3d2c",
"call_id": "00b1d622a8f04f4f8f3a3c2d9e5b7a11",
"agent_id": "1b81a241c0e44f5c9d1f0e2a7c3b9d10",
"data": {
"message": "check_availability",
"level": "info",
"latency_ms": null,
"name": "check_availability",
"args": {"doctor": "Dr Mehta", "date": "2026-10-02"},
"url": "https://api.example.com/availability"
}
}
| Field | Meaning |
|---|---|
id | The event id. The same event sent to two targets has the same id. |
type | The event type. See Webhook events. |
created_at | When the event happened, in UTC. |
workspace_id, call_id, agent_id | Which call it belongs to. |
data.message | A one-line description. |
data.level | info, warning or error. |
data.latency_ms | For timing events, the latency; otherwise null. |
data.* | Fields specific to the event type. |
Headers:
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | Vaakyo-Webhooks/1.0 |
X-Vaakyo-Event | The event type. |
X-Vaakyo-Delivery | The delivery id (whd_...). |
X-Vaakyo-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256> |
Verify the signature
The signature is an HMAC-SHA256 of the string <t>.<raw request body>, keyed with your secret (whsec_...).
- Read the raw body, before any JSON parsing.
- Split the header into
tandv1. - Reject the request if
tis more than 5 minutes from now (this stops replays). - Compute the HMAC and compare it to
v1in constant time.
Python
import hashlib
import hmac
import time
def verify(secret: str, header: str | None, raw_body: bytes, tolerance: int = 300) -> bool:
parts = dict(item.split("=", 1) for item in (header or "").split(",") if "=" in item)
timestamp, signature = parts.get("t", ""), parts.get("v1", "")
if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > tolerance:
return False
expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)
Node
import crypto from "node:crypto";
export function verify(secret, header, rawBody, tolerance = 300) {
if (typeof header !== "string") return false;
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2)));
const timestamp = Number(parts.t);
if (!timestamp || Math.abs(Date.now() / 1000 - timestamp) > tolerance) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${parts.t}.`)
.update(rawBody)
.digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1 ?? "");
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
In Express, read the raw body with express.raw({ type: "application/json" }) on the webhook route.
Respond
- Respond with any
2xxwithin 10 seconds. Do slow work after you respond. - Redirects are not followed; a
3xxcounts as a failure. - One attempt. Each delivery is sent once. Any other status, a timeout or a connection error makes it
failed, and it is not sent again. Keep your endpoint up, and read missed calls from the API if you need them. - Order. Events are sent roughly in order. Sort by
created_atif order matters.
Delivery log
Every delivery is logged. Read it in the console under Webhooks, or on the Logs → Webhooks tab (see Logs), filtered by endpoint, status, event type, call and time. Each delivery shows your server’s status code, how long it took to answer and when it was sent; open one for the request body and your last response. Deliveries are kept for 30 days.
Delivery status | Meaning |
|---|---|
pending | Not sent yet. |
delivered | Your server answered 2xx. |
failed | It was not answered with 2xx, or the endpoint was deleted. It is not sent again. |
Rotate a secret
Rotate an endpoint’s secret, or the default secret used for agents’ and campaigns’ webhook URLs, under Webhooks in the console. The new secret is shown once. The old secret stops working at once, so update your server first and keep accepting both secrets for a moment if you can.