Skip to content
DhvaneeDocs
Dashboard
On this page

Webhooks

Receive contact and call events at your own HTTPS endpoint, signed with HMAC-SHA256, with retries and a delivery log.

A webhook is a message Dhvanee sends to your server when something happens, so you do not have to keep asking. Each message is an HTTPS POST with a JSON body and a signature you can check to be sure it really came from Dhvanee.

The machine-readable contract is openapi.public.yaml. Download it for clients and codegen. This site has no live Try-it console.
Webhooks are set up in the dashboard, not with an API key. Open Settings → Developer access → Webhooks. Only the workspace Owner and Admins can do this.

Set one up

  • 1. In Settings → Developer access → Webhooks, click to add a webhook.
  • 2. Enter the HTTPS address of your endpoint and tick the events you want. You need at least one event.
  • 3. Create it, then copy the signing secret now. It is shown once and cannot be shown again.
  • 4. Build your endpoint to verify the signature and answer quickly (see below).
  • To change the address or events, or to rotate the secret, create a new webhook and delete the old one.

Creating a webhook sends nothing to your address. The first message arrives when a chosen event happens.

What your address must be

  • https only, with no user name or password in it, between 12 and 2000 characters.
  • A public address. Names such as localhost, ending in .local, .internal or .localhost, and addresses that resolve to private or internal networks are refused. The address is checked again before every delivery.
  • The refusals read Webhook URL must be an HTTPS address, Webhook host must be publicly routable, Webhook host could not be resolved and, for an unknown event name, Webhook event name is not supported.

Events

EventSent when
createdA contact is created.
field_changeA contact's details change.
mergedTwo contacts are merged.
importedContacts are brought in by an import.
syncA CRM sync creates or updates a contact.
noteA note is added to a contact.
consentYou can subscribe to it, but Dhvanee does not send it yet.
taskA task on a contact is marked done.
call_startedAn outbound call has been dialled.
call_endedAn outbound call finishes, or you stop it.
call_analyzedThe analysis of a finished call is ready.
  • Contact events fire for changes from the dashboard, imports, CRM sync and the Contacts API alike.
  • Call events fire for every outbound call of the workspace: calls placed with POST /v1/calls and calls made by campaigns. For an API call, call_id is the id POST /v1/calls returned, so GET /v1/calls/{id} finds it. For a campaign call the call_id identifies that call but is not available through GET /v1/calls.

What a delivery looks like

Each delivery is a POST to your address with the headers below and a compact JSON body.

HeaderMeaning
Content-Typeapplication/json
X-Dhvanee-EventThe event name, for example call_ended.
X-Dhvanee-DeliveryThe id of this delivery. It stays the same on every retry of the same delivery.
X-Dhvanee-TimestampUnix time in seconds when this attempt was signed. It changes on every retry.
X-Dhvanee-Signaturesha256= followed by the hex HMAC-SHA256 signature (see below).
curl -sS -X POST "YOUR_ENDPOINT_URL" \
  -H "Content-Type: application/json" \
  -H "X-Dhvanee-Event: call_ended" \
  -H "X-Dhvanee-Delivery: 9f3c0d2e-0000-4000-8000-000000000001" \
  -H "X-Dhvanee-Timestamp: 1730000000" \
  -H "X-Dhvanee-Signature: sha256=3b1f..." \
  -d '{"id":"c0a8...","type":"call_ended","tenant_id":"...","call_id":"6f1c...","created_at":"2026-11-04T12:00:00+00:00","data":{"call":{"id":"6f1c...","agent":"ff29...","to":"+919876543210","from":"+918000000000","status":"completed","duration":42,"transcript":null}}}'

This is the request your endpoint receives, not one you send.

Body of a call event

{
  "id": "c0a8e1d2-0000-4000-8000-000000000002",
  "type": "call_ended",
  "tenant_id": "WORKSPACE_ID",
  "call_id": "6f1c0d2e-0000-4000-8000-000000000003",
  "created_at": "2026-11-04T12:00:00+00:00",
  "data": {
    "call": {
      "id": "6f1c0d2e-0000-4000-8000-000000000003",
      "agent": "AGENT_ID",
      "to": "+919876543210",
      "from": "+918000000000",
      "status": "completed",
      "duration": 42,
      "transcript": null
    }
  }
}
  • data.call is the same call object GET /v1/calls/{id} returns, as it was when the event happened. At call_started its status is in_progress.
  • call_analyzed adds data.summary and data.extracted_fields next to data.call.
  • id identifies the event. To spot repeats, use the X-Dhvanee-Delivery header, not id.

Body of a contact event

{
  "id": "5d2b7a10-0000-4000-8000-000000000004",
  "type": "created",
  "tenant_id": "WORKSPACE_ID",
  "contact_id": "6f1c0d2e-0000-4000-8000-000000000005",
  "created_at": "2026-11-04T12:00:00+00:00",
  "data": {"via": "public_api"}
}

data depends on the event. For field_change it lists which fields changed and the changes made.

Verify the signature

The signature is an HMAC-SHA256 of the timestamp, a dot, and the raw request body, computed with your signing secret as the key, written in lower-case hex and prefixed with sha256=. Always compute it over the exact bytes you received. If you parse the JSON and write it out again, the bytes change and the check fails.

import hashlib
import hmac
import time


def verify(secret: str, raw_body: bytes, timestamp: str, signature: str) -> bool:
    # Refuse old or replayed deliveries.
    if abs(time.time() - int(timestamp)) > 300:
        return False
    signed = timestamp.encode() + b"." + raw_body
    expected = "sha256=" + hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)
import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(secret, rawBody, timestamp, signature) {
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  const expected = "sha256=" + createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(signature);
  return a.length === b.length && timingSafeEqual(a, b);
}
Store the signing secret like an API key, in a secrets manager. Anyone who has it can forge deliveries.

Answering, retries and the delivery log

  • Answer fast. Reply within 20 seconds (8 seconds to connect) with any status below 400, such as 200 or 204. Do your real work after replying.
  • Redirects are not followed. Give the final address.
  • Failures are retried. A timeout, a connection error or a status of 400 or more counts as a failed attempt. The delivery is tried again on the next delivery run, currently about every 2 minutes, up to 8 attempts in total. After the 8th failure it is marked failed and is not sent again.
  • Not instant. Events are queued and sent by that same run, so a message normally arrives within a couple of minutes, and a run sends up to 25 queued deliveries, oldest first. A bulk import can therefore be delivered over a longer time.
  • At least once. The same delivery can reach you more than once, for example when your reply was slow. Treat each X-Dhvanee-Delivery id as single-use and keep the ones you have seen for at least 24 hours.
  • Order is not guaranteed when some deliveries are retried. Use created_at in the body to put events in order.
  • If you delete the webhook or the workspace is suspended, deliveries still waiting are not sent.
  • Delivery log. Settings → Developer access → Developer logs → Webhook Log lists recent deliveries with the endpoint, event, HTTP status, number of attempts and the last error. By default entries are kept for 24 hours on Free and Starter, 72 hours on Growth and 168 hours (7 days) on Pro and Enterprise.

Harden your endpoint

  • Verify X-Dhvanee-Signature on the raw body before you trust anything in it.
  • Reject a delivery when abs(now_unix - X-Dhvanee-Timestamp) is more than 300 seconds. Keep your server clock correct.
  • Compare signatures in constant time, as in the examples above.
  • Ignore events you did not subscribe to, and answer unknown event types with 200.
  • Make your handler safe to run twice for the same delivery.
Webhooks · Dhvanee Docs