Developers

Webhooks: every event, with a sample

Every event AI Call Studio can send your server, with a sample of each, the headers, how to check the signature, and what happens when a delivery fails.

Developers

Before you start

  • A public https:// URL on your server that answers a POST quickly.
  • The Developers page in your dashboard, where a webhook is added, its events picked and a test event sent.
  1. Add a webhook

    On Developers, Webhooks, add your URL and pick the events it should receive. Its signing secret is shown once: store it with your other secrets.

  2. Send a test event

    Press Send test event, or send any event's sample, to check your server answers and your signature check passes. Each delivery and what your server answered is in the delivery log beside it.

  3. Check every delivery

    Work out the signature from the raw body and refuse anything that does not match, then answer 2xx at once and do the slow work afterwards. Ignore a delivery id you have already handled: a retry carries the same one.

Which events can I receive?

17 events, plus test, which is sent only when you press Send test event on the Developers page. Pick the events per webhook.

Events
EventWhen it is sent
call.startedA call was answered: the customer picked up an outgoing call, or an incoming call was taken.
call.completedA call ended and its outcome is known: answered, or not (no answer, voicemail, failed).
call.no_answerAn outgoing call was not answered: no answer, busy, or an answering machine.
call.failedAn outgoing call could not be connected at all.
call.handed_overThe AI tried to hand a call to a person. outcome says whether someone took it.
call.wrapped_upA person saved their wrap-up for a call after call.completed: the outcome they chose.
lead.capturedA finished call captured details: the fields your agent collects, and the lead it saved.
contact.opted_outA number went on the Do-Not-Call list: asked on a call, replied STOP, or added by someone.
message.deliveredA WhatsApp, SMS or email message reached the person. channel says which.
message.readA WhatsApp message was read, or an email opened.
message.repliedThe person replied to a message.
campaign.status_changedA campaign started, paused, finished or was deleted.
campaign.completedA campaign finished: everyone it may ring has been rung.
qa.gradedA call was graded against a quality scorecard.
wallet.low_balanceThe wallet went below the low-balance mark. Top up before calls stop.
inbox.message_receivedA customer wrote to you on WhatsApp: a message arrived in the inbox.
inbox.message_sentA WhatsApp message went to a customer one to one: from the inbox, the call screen or the API.

One event per kind (message.delivered, message.read, message.replied) for every channel; the message's channel says whether it was WhatsApp, SMS or email. inbox.message_received and inbox.message_sent are one-to-one WhatsApp messages (the inbox, the call screen and the sending API), not campaign messages.

What does a delivery look like?

A POST of JSON to your URL. The body is always { "event", "data", "ts", "id" }: the event's name, its data, when it happened (Unix seconds) and the delivery's id. Each request carries these headers:

  • X-Aicallstudio-Signature: sha256= and the hex HMAC-SHA256 of the raw body, keyed with the webhook's signing secret (it starts with whsec_ and is shown once).
  • X-Aicallstudio-Event: the event's name.
  • X-Aicallstudio-Delivery: one id per event, the same on every retry. Keep the ids you have handled and ignore a repeat.

call.started

A call was answered: the customer picked up an outgoing call, or an incoming call was taken.

call.started, a sample delivery
{
  "event": "call.started",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call": {
      "room": "sample-room-1a2b3c4d",
      "direction": "outbound",
      "agent_id": "00000000-0000-0000-0000-000000000003",
      "team_id": null,
      "contact_id": "00000000-0000-0000-0000-000000000002",
      "campaign_id": null,
      "initiator": "api",
      "answered_at": "2026-11-27T10:30:05+05:30"
    }
  }
}

call.completed

A call ended and its outcome is known: answered, or not (no answer, voicemail, failed).

call.completed, a sample delivery
{
  "event": "call.completed",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call": {
      "id": "00000000-0000-0000-0000-000000000001",
      "contact_id": "00000000-0000-0000-0000-000000000002",
      "campaign_id": null,
      "agent_id": "00000000-0000-0000-0000-000000000003",
      "direction": "outbound",
      "status": "completed",
      "duration_seconds": 94,
      "disposition": "interested",
      "disposition_label": "Interested",
      "classification": "hot",
      "score": 82,
      "summary": "Asked for a site visit on Saturday.",
      "transcript": "Agent: Hello, am I speaking with Asha?\nLead: Yes.",
      "transcript_turns": [
        {
          "speaker": "agent",
          "text": "Hello, am I speaking with Asha?"
        },
        {
          "speaker": "lead",
          "text": "Yes."
        }
      ],
      "placed_by": {
        "kind": "ai_agent",
        "id": "00000000-0000-0000-0000-000000000003",
        "name": "Priya"
      },
      "cost_inr": 4.5,
      "disposition_by": "ai"
    }
  }
}

call.no_answer

An outgoing call was not answered: no answer, busy, or an answering machine.

call.no_answer, a sample delivery
{
  "event": "call.no_answer",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call": {
      "id": "00000000-0000-0000-0000-000000000001",
      "contact_id": "00000000-0000-0000-0000-000000000002",
      "campaign_id": null,
      "agent_id": "00000000-0000-0000-0000-000000000003",
      "direction": "outbound",
      "status": "no-answer",
      "reason": "no-answer",
      "room": "sample-room-1a2b3c4d"
    }
  }
}

call.failed

An outgoing call could not be connected at all.

call.failed, a sample delivery
{
  "event": "call.failed",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call": {
      "id": "00000000-0000-0000-0000-000000000001",
      "contact_id": "00000000-0000-0000-0000-000000000002",
      "campaign_id": null,
      "agent_id": "00000000-0000-0000-0000-000000000003",
      "direction": "outbound",
      "status": "failed",
      "reason": "dial_failed",
      "room": "sample-room-1a2b3c4d"
    }
  }
}

call.handed_over

The AI tried to hand a call to a person. outcome says whether someone took it.

call.handed_over, a sample delivery
{
  "event": "call.handed_over",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call": {
      "room": "sample-room-1a2b3c4d",
      "contact_id": "00000000-0000-0000-0000-000000000002",
      "agent_id": "00000000-0000-0000-0000-000000000003",
      "team_id": null
    },
    "outcome": "connected",
    "reason": "The customer asked for a person.",
    "to": "Collections desk",
    "attempt": 1
  }
}

call.wrapped_up

A person saved their wrap-up for a call after call.completed: the outcome they chose.

call.wrapped_up, a sample delivery
{
  "event": "call.wrapped_up",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call": {
      "id": "00000000-0000-0000-0000-000000000001",
      "contact_id": "00000000-0000-0000-0000-000000000002",
      "disposition": "promise_to_pay",
      "disposition_label": "Promise to pay",
      "disposition_by": "staff",
      "previous_disposition": "callback",
      "wrap_up": {
        "note": "Will pay on the 5th."
      }
    }
  }
}

lead.captured

A finished call captured details: the fields your agent collects, and the lead it saved.

lead.captured, a sample delivery
{
  "event": "lead.captured",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call_id": "00000000-0000-0000-0000-000000000001",
    "contact_id": "00000000-0000-0000-0000-000000000002",
    "campaign_id": null,
    "fields": {
      "promise_date": "2026-12-05",
      "amount": "12500"
    },
    "lead": {
      "name": "Asha Verma",
      "phone": "+919876543210"
    }
  }
}

contact.opted_out

A number went on the Do-Not-Call list: asked on a call, replied STOP, or added by someone.

contact.opted_out, a sample delivery
{
  "event": "contact.opted_out",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "phone": "9876543210",
    "contact_id": "00000000-0000-0000-0000-000000000002",
    "source": "auto",
    "call_id": "00000000-0000-0000-0000-000000000001"
  }
}

message.delivered

A WhatsApp, SMS or email message reached the person. channel says which.

message.delivered, a sample delivery
{
  "event": "message.delivered",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "message": {
      "id": "00000000-0000-0000-0000-000000000004",
      "channel": "whatsapp",
      "status": "delivered",
      "campaign_id": "00000000-0000-0000-0000-000000000005",
      "contact_id": "00000000-0000-0000-0000-000000000002"
    }
  }
}

message.read

A WhatsApp message was read, or an email opened.

message.read, a sample delivery
{
  "event": "message.read",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "message": {
      "id": "00000000-0000-0000-0000-000000000004",
      "channel": "whatsapp",
      "status": "read",
      "campaign_id": "00000000-0000-0000-0000-000000000005",
      "contact_id": "00000000-0000-0000-0000-000000000002"
    }
  }
}

message.replied

The person replied to a message.

message.replied, a sample delivery
{
  "event": "message.replied",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "message": {
      "id": "00000000-0000-0000-0000-000000000004",
      "channel": "whatsapp",
      "status": "replied",
      "campaign_id": "00000000-0000-0000-0000-000000000005",
      "contact_id": "00000000-0000-0000-0000-000000000002"
    }
  }
}

campaign.status_changed

A campaign started, paused, finished or was deleted.

campaign.status_changed, a sample delivery
{
  "event": "campaign.status_changed",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "campaign_id": "00000000-0000-0000-0000-000000000005",
    "status": "paused"
  }
}

campaign.completed

A campaign finished: everyone it may ring has been rung.

campaign.completed, a sample delivery
{
  "event": "campaign.completed",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "campaign_id": "00000000-0000-0000-0000-000000000005",
    "status": "completed"
  }
}

qa.graded

A call was graded against a quality scorecard.

qa.graded, a sample delivery
{
  "event": "qa.graded",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "call_id": "00000000-0000-0000-0000-000000000001",
    "scorecard": "Collections quality",
    "score": 86,
    "band": "pass",
    "graded": "agent"
  }
}

wallet.low_balance

The wallet went below the low-balance mark. Top up before calls stop.

wallet.low_balance, a sample delivery
{
  "event": "wallet.low_balance",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "balance_inr": 180,
    "low_balance_mark_inr": 200
  }
}

inbox.message_received

A customer wrote to you on WhatsApp: a message arrived in the inbox.

inbox.message_received, a sample delivery
{
  "event": "inbox.message_received",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "message": {
      "id": "00000000-0000-0000-0000-000000000006",
      "channel": "whatsapp",
      "direction": "inbound",
      "text": "Can I pay on Friday?",
      "kind": "text",
      "at": "2026-11-28T10:30:05+05:30",
      "contact_id": "00000000-0000-0000-0000-000000000002"
    },
    "contact": {
      "name": "Asha Verma",
      "phone": "+919876543210"
    }
  }
}

inbox.message_sent

A WhatsApp message went to a customer one to one: from the inbox, the call screen or the API.

inbox.message_sent, a sample delivery
{
  "event": "inbox.message_sent",
  "ts": 1772634500,
  "id": "1b2c3d4e5f6a47b8c9d0e1f2a3b4c5d6",
  "data": {
    "message": {
      "id": "00000000-0000-0000-0000-000000000007",
      "channel": "whatsapp",
      "direction": "outbound",
      "text": "Your EMI of Rs 12,500 is due on 5 December.",
      "template": "emi_reminder",
      "status": "sent",
      "via": "api",
      "at": "2026-11-28T10:31:00+05:30",
      "contact_id": "00000000-0000-0000-0000-000000000002"
    },
    "contact": {
      "name": "Asha Verma",
      "phone": "+919876543210"
    }
  }
}

How do I check a delivery is really from AI Call Studio?

Work out the signature from the raw body, before parsing it, and refuse any request where it does not match. Compare in constant time.

Node.js
import crypto from "node:crypto";

// rawBody: the request body exactly as received (a Buffer), before any JSON parsing.
function isFromAiCallStudio(rawBody, signatureHeader, secret) {
  const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(signatureHeader || "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// isFromAiCallStudio(req.rawBody, req.get("X-Aicallstudio-Signature"), process.env.WEBHOOK_SECRET)
Python
import hashlib, hmac

def is_from_ai_call_studio(raw_body: bytes, signature_header: str, secret: str) -> bool:
    expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature_header or "")

# is_from_ai_call_studio(request.body, request.headers["X-Aicallstudio-Signature"], WEBHOOK_SECRET)
PHP
<?php
// The raw body, before any JSON decoding.
$raw = file_get_contents("php://input");
$expected = "sha256=" . hash_hmac("sha256", $raw, getenv("WEBHOOK_SECRET"));
$sent = $_SERVER["HTTP_X_AICALLSTUDIO_SIGNATURE"] ?? "";
if (!hash_equals($expected, $sent)) {
    http_response_code(401);
    exit;
}
$event = json_decode($raw, true);

What happens if my server is down?

Answer with any 2xx within 10 seconds. Anything else, or no answer, is retried up to 5 times, after 1, 2, 4, 8, 16 minutes. After 50 failed deliveries in a row the webhook is paused and your workspace is told; nothing is sent until you resume it, and events in between are skipped, not sent later. Every delivery and its answer is in the delivery log on the Developers page.

Should I use webhooks or ask the API?

Use webhooks for anything that should happen as soon as a call or message changes: they arrive within seconds and cost you no requests. Ask the API (list calls with a since time) to fill a gap after your server was down, because a paused webhook skips events rather than sending them later.

Costs and what to watch

  • Once a webhook is paused after repeated failures, events in between are skipped, not sent later. Resume it on the Developers page, then fetch what you missed from the calls list.
  • No-code tools that cannot check the signature should treat their hook address as a password: anyone who knows it can post to it.
FAQ

Questions, answered.

How do I verify an AI Call Studio webhook signature?
Compute sha256= plus the hex HMAC-SHA256 of the raw request body, keyed with the webhook's signing secret, and compare it in constant time with the X-Aicallstudio-Signature header. Do it before parsing the JSON.
Is a webhook sent once per call?
Usually, but build for repeats: a delivery that does not get a 2xx in time is retried with the same X-Aicallstudio-Delivery id. A person's wrap-up after the call is a separate event, call.wrapped_up, an update of the same call.

Put AI Call Studio on your phone lines.

Book a 30-minute walkthrough, or call us right now: +91 922 222 1378