Developers

Webhook documentation

CallTracker sends a signed HTTP POST with a JSON body to your URL when a tracked call ends. Webhooks push events as they happen; to read calls on demand, use the REST API.

When webhooks fire

  • call.completed — when a connected call ends. Enabled by default.
  • call.missed — when a forwarded call is not answered. Off by default; enable it per integration.
  • call.outcome_changed — when a call is marked qualified lead, customer, existing customer, not a lead, wrong number or spam (by a person or by AI call analysis), when its value changes, or when the outcome is removed. Turn on "When a call outcome changes" per integration; off by default on webhooks created before outcome events existed.
  • You can set a minimum duration so short completed calls are not sent. It does not apply to outcome changes, which a person or AI decided.

Request

  • Method: POST, body: JSON (Content-Type: application/json).
  • X-Event-Type: the event name, for example call.completed.
  • X-CallTracker-Signature: t=<unix timestamp>,v1=<hex HMAC-SHA256 of "<timestamp>.<raw body>" keyed with your signing secret>.
  • X-CallTracker-Event-Id and Idempotency-Key: the same ID on every retry of one delivery, so you can ignore duplicates.
  • X-Webhook-Secret: the signing secret itself, sent for existing receivers during a deprecation period. Verify the signature instead; this header will be removed.
  • User-Agent: CallTracker-Webhooks/1.0.

Verify the signature

Open Settings → CRM, click Configure on your webhook and choose Show to copy the signing secret (whsec_…). Rotate it from the same place; new requests are signed with the new secret immediately. Compute the HMAC over the raw request body exactly as received, compare it in constant time, and reject timestamps more than five minutes old.

Node.js

import crypto from "node:crypto";

const TOLERANCE_SECONDS = 300;

export function verifyCallTrackerSignature(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const timestamp = Number(parts.t);
  if (!timestamp || Math.abs(Date.now() / 1000 - timestamp) > TOLERANCE_SECONDS) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
  const signatures = header.split(",").filter((p) => p.startsWith("v1=")).map((p) => p.slice(3));
  return signatures.some(
    (sig) => sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))
  );
}

// Express: app.post("/calltracker", express.raw({ type: "application/json" }), (req, res) => {
//   const ok = verifyCallTrackerSignature(req.body.toString("utf8"), req.get("X-CallTracker-Signature"), process.env.CALLTRACKER_WEBHOOK_SECRET);
//   if (!ok) return res.sendStatus(400);
//   res.sendStatus(204);
// });

Python

import hashlib, hmac, time

TOLERANCE_SECONDS = 300

def verify_calltracker_signature(raw_body: bytes, header: str, secret: str) -> bool:
    parts = [p.split("=", 1) for p in header.split(",") if "=" in p]
    timestamp = next((int(v) for k, v in parts if k == "t" and v.isdigit()), None)
    if timestamp is None or abs(time.time() - timestamp) > TOLERANCE_SECONDS:
        return False
    signed = f"{timestamp}.".encode() + raw_body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(v, expected) for k, v in parts if k == "v1")

Example payload

{
  "event": "call.completed",
  "call": {
    "id": "clx2k9d0f0001",
    "callerNumber": "+4791234567",
    "duration": 184,
    "status": "completed",
    "timestamp": "2026-10-01T09:14:03.000Z",
    "recordingUrl": null,
    "transcriptionText": null
  },
  "placement": {
    "id": "clx2k8z1a0000",
    "name": "Google Ads - Search",
    "trackingNumber": "+4721000000"
  },
  "attribution": {
    "trafficSource": "GOOGLE_ADS",
    "utmSource": "google",
    "utmMedium": "cpc",
    "utmCampaign": "plumbing-oslo",
    "utmTerm": "emergency plumber",
    "utmContent": null,
    "gclid": "Cj0KCQjw...",
    "fbclid": null,
    "msclkid": null,
    "referrerUrl": "https://www.google.com/",
    "landingPage": "https://example.com/emergency"
  },
  "workspace": {
    "id": "clx2k7y2b0000",
    "name": "Example Plumbing"
  }
}

Values above are illustrative.

Outcome change events

A call.outcome_changed event carries the call, placement, attribution and workspace like the call events, plus the new and previous outcome. Each change is a delivery of its own with its own event ID. If an older change is still waiting for a retry when a newer one is made, the older one is dropped, so your endpoint never receives an outdated outcome after a newer one.

{
  "event": "call.outcome_changed",
  "call": {
    "id": "clx2k9d0f0001",
    "callerNumber": "+4791234567",
    "duration": 184,
    "status": "completed",
    "timestamp": "2026-10-01T09:14:03.000Z",
    "recordingUrl": null
  },
  "outcome": {
    "value": "customer",
    "label": "Became a customer",
    "stage": "customer",
    "source": "manual",
    "amount": 4500,
    "currency": "NOK",
    "setAt": "2026-10-02T13:40:11.000Z"
  },
  "previousOutcome": {
    "value": "qualified_lead",
    "label": "Qualified lead",
    "stage": "qualified",
    "source": "ai",
    "amount": null,
    "currency": null,
    "setAt": "2026-10-01T09:20:45.000Z"
  },
  "placement": { "id": "clx2k8z1a0000", "name": "Google Ads - Search", "trackingNumber": "+4721000000" },
  "attribution": {
    "trafficSource": "GOOGLE_ADS",
    "utmSource": "google",
    "utmMedium": "cpc",
    "utmCampaign": "plumbing-oslo",
    "utmTerm": "emergency plumber",
    "utmContent": null,
    "gclid": "Cj0KCQjw...",
    "gbraid": null,
    "wbraid": null,
    "fbclid": null,
    "msclkid": null,
    "referrerUrl": "https://www.google.com/",
    "landingPage": "https://example.com/emergency"
  },
  "workspace": { "id": "clx2k7y2b0000", "name": "Example Plumbing" }
}
FieldDescription
outcome.valuequalified_lead, customer, existing_customer, not_a_lead, wrong_number, spam, or null when the outcome was removed.
outcome.stagequalified, customer, existing_customer, junk or none: a coarser grouping to route on.
outcome.sourcemanual when a person chose it, ai when AI call analysis suggested it.
outcome.amount / currencyThe value entered on the call (qualified leads and customers only) and its ISO currency.
outcome.setAtWhen the outcome was set. Use it to order changes: a newer change always has a later setAt.
previousOutcome.*The outcome before this change, in the same shape.

Fields

FieldDescription
eventcall.completed, call.missed or call.outcome_changed.
call.idCallTracker's ID for the call.
call.callerNumberThe caller's number in E.164 format.
call.durationCall length in seconds (0 for missed calls).
call.statusFinal call status reported by the carrier.
call.timestampWhen the call started (ISO 8601, UTC).
call.recordingUrlUsually null: recordings are processed after the call ends, so they are rarely ready when the event is sent.
call.transcriptionTextUsually null for the same reason; transcripts are generated after the call.
placement.*ID, name and tracking number of the placement that received the call.
attribution.trafficSourceDetected traffic source for website calls (null for offline placements).
attribution.utm*UTM source, medium, campaign, term and content captured by the website snippet.
attribution.gclid / fbclid / msclkidGoogle, Meta and Microsoft click IDs, when present.
attribution.referrerUrl / landingPageReferring URL and first page of the visit.
workspace.*ID and name of the workspace that owns the placement.

Delivery

  • Respond with any 2xx status within 10 seconds to mark the delivery successful.
  • Network errors, timeouts, 408, 429 and 5xx responses are retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours (seven attempts in total). Other 4xx responses are not retried.
  • Redirects are not followed; point the webhook at the final URL.
  • The last 25 deliveries, with status code, attempts and next retry, are listed under Configure in Settings → CRM, where you can retry a failed delivery or send a test event.
  • Endpoints must use https://; URLs that resolve to private or internal network addresses are rejected.

Set up a webhook

  1. Open Settings → CRM and click Connect on the Custom Webhook card.
  2. Paste your endpoint URL and choose which events to send.
  3. Open Configure, copy the signing secret and add signature verification to your endpoint.
  4. Click Send test event, then call one of your tracking numbers and check that your endpoint receives the payload.

Prefer no code? The Zapier integration receives the same payload, and Slack and Microsoft Teams receive a formatted message instead.

Start sending call data to your stack

Webhooks are included in CallTracker Pro at no extra cost.