Be told when something happens
A webhook is a message from Chatilo to your server. When a customer writes, an order is paid or a booking is made, we POST a small piece of JSON to an address you choose. You don’t have to keep asking whether anything is new.
Set one up #
There are two ways, and they deliver exactly the same thing.
By hand, in the app #
Open API and webhooks, choose New webhook, enter your address and tick the events you want. One webhook can listen for several events. You are shown its signing secret once: copy it. A workspace can have five of these.
From code, through the API #
Subscribe an address to one event with POST /hooks. The response carries the subscription’s id and its signing secret, shown that once. Subscribe again for each further event; a workspace can hold 50. This is the way Zapier, Make and n8n connect.
curl -X POST "https://chatilo.me/api/v1/hooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "message.received",
"target_url": "https://example.com/hooks/chat"
}'Either way, your address must be reachable from the internet. Addresses on a private network (localhost, 10.x, 192.168.x and the like) are refused when you save them and again each time we deliver.
What a delivery looks like #
Every delivery is an HTTP POST with a JSON body in the same envelope:
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "message.received",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"message": {
"id": 3001,
"direction": "in",
"kind": "text",
"body": "Hi, is the blue kurta available in medium?",
"status": "received",
"error": null,
"media": null,
"sender": null,
"at": "2026-01-31 09:30:00",
"time": "3:00 pm",
"day": "31 Jan 2026"
},
"conversation_id": 2001,
"contact_id": 1001,
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"conversation": {
"id": 2001,
"contact_id": 1001,
"channel": "whatsapp",
"status": "open",
"assigned_to": null,
"last_message_preview": "Hi, is the blue kurta available in medium?",
"last_message_at": "2026-01-31T09:30:00Z",
"window_open": true,
"created_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/inbox?c=2001"
}
}
}| Field | Meaning |
|---|---|
id | Identifies this event. It is the same on every retry and for every address that receives the event, so use it to ignore repeats. |
event | The event’s name. |
created_at | When it happened. |
data | What happened. Its contents depend on the event; the objects inside are the same objects the API returns. |
And these headers:
| Header | Value |
|---|---|
Content-Type | application/json |
X-Chatilo-Event | The event’s name, so you can route without reading the body. |
X-Chatilo-Delivery | The same value as id in the body. |
X-Chatilo-Signature | sha256= followed by the signature. See below. |
Check the signature #
Your address is public, so anyone could post to it. The signature proves a delivery came from Chatilo and wasn’t changed on the way. Check it before you trust anything in the body.
The signature is the HMAC-SHA256 of the raw request body, keyed with the webhook’s signing secret, written in hexadecimal after sha256=. To check it:
- Take the body exactly as it arrived, as bytes. Don’t parse it and write it out again first: even a changed space gives a different signature.
- Compute the HMAC-SHA256 of those bytes with your secret, and put
sha256=in front. - Compare it with the
X-Chatilo-Signatureheader using a constant-time comparison. If they differ, answer401and stop.
Each of these is a complete receiver you can run:
<?php
// The signing secret you were shown when the webhook was made.
$secret = getenv('CHAT_WEBHOOK_SECRET');
// Use the body exactly as it arrived: decode it only after checking it.
$body = file_get_contents('php://input');
$sent = $_SERVER['HTTP_X_CHATILO_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $body, $secret);
if (!hash_equals($expected, $sent)) {
http_response_code(401);
exit('Bad signature');
}
$delivery = json_decode($body, true);
// The same id arrives again when a delivery is retried: do the work once.
if (already_handled($delivery['id'])) {
http_response_code(200);
exit('Seen');
}
// Answer quickly; do slow work after responding or in a queue.
handle_event($delivery['event'], $delivery['data']);
http_response_code(200);
echo 'OK';
function already_handled(string $id): bool
{
// Look the id up where you record handled deliveries (a database table with a unique index works well).
return false;
}
function handle_event(string $event, array $data): void
{
if ($event === 'message.received') {
error_log($data['contact']['name'] . ' wrote: ' . $data['message']['body']);
}
}// Node.js 18 or later, no packages needed.
const http = require('node:http');
const crypto = require('node:crypto');
// The signing secret you were shown when the webhook was made.
const secret = process.env.CHAT_WEBHOOK_SECRET;
const handled = new Set(); // use a database in real life
function signatureIsValid(body, sent) {
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(body).digest('hex');
const a = Buffer.from(expected);
const b = Buffer.from(sent || '');
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
http.createServer((req, res) => {
const chunks = [];
req.on('data', (chunk) => chunks.push(chunk));
req.on('end', () => {
// Use the body exactly as it arrived: parse it only after checking it.
const body = Buffer.concat(chunks);
if (!signatureIsValid(body, req.headers['x-chatilo-signature'])) {
res.writeHead(401).end('Bad signature');
return;
}
const delivery = JSON.parse(body.toString('utf8'));
// The same id arrives again when a delivery is retried: do the work once.
if (!handled.has(delivery.id)) {
handled.add(delivery.id);
if (delivery.event === 'message.received') {
console.log(`${delivery.data.contact.name} wrote: ${delivery.data.message.body}`);
}
}
res.writeHead(200).end('OK');
});
}).listen(3000);# Python 3, standard library only.
import hashlib
import hmac
import json
import os
from http.server import BaseHTTPRequestHandler, HTTPServer
# The signing secret you were shown when the webhook was made.
SECRET = os.environ["CHAT_WEBHOOK_SECRET"].encode()
handled = set() # use a database in real life
def signature_is_valid(body: bytes, sent: str) -> bool:
expected = "sha256=" + hmac.new(SECRET, body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sent or "")
class Handler(BaseHTTPRequestHandler):
def do_POST(self):
# Use the body exactly as it arrived: parse it only after checking it.
body = self.rfile.read(int(self.headers.get("Content-Length", 0)))
if not signature_is_valid(body, self.headers.get("X-Chatilo-Signature", "")):
self.send_response(401)
self.end_headers()
return
delivery = json.loads(body)
# The same id arrives again when a delivery is retried: do the work once.
if delivery["id"] not in handled:
handled.add(delivery["id"])
if delivery["event"] == "message.received":
print(f'{delivery["data"]["contact"]["name"]} wrote: {delivery["data"]["message"]["body"]}')
self.send_response(200)
self.end_headers()
self.wfile.write(b"OK")
HTTPServer(("", 3000), Handler).serve_forever()Each webhook and each hook subscription has its own secret. If you lose one, delete the webhook and make it again.
Responding and retries #
- Answer with any 2xx status within 10 seconds. The body of your answer is ignored. Do slow work after you have answered, or hand it to a queue.
- Anything else is retried. A different status, a timeout or a failed connection counts as a failure. We try three times in all: the second attempt about 30 seconds after the first, the third about a minute after that. Then that delivery is given up; later events are still sent.
- Expect repeats, and expect them out of order. A retry can arrive after a newer event. Use
idto drop repeats, and where order matters, fetch the item from the API rather than trusting the order of arrival. - Answer
410 Goneto unsubscribe. For a subscription made through the API, a 410 removes it and nothing more is sent. Zapier and Make do this when an automation is switched off. - See how it went. The API and webhooks page shows the result of the latest delivery to each address, and GET /hooks returns it as
last_status.
Events and payloads #
Open an event to see a full example delivery. Some events are sent the moment they happen; others are noticed by a check that runs once a minute, so they arrive within about a minute.
Messages and conversations
message.receivedA customer sends a messageStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "message.received",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"message": {
"id": 3001,
"direction": "in",
"kind": "text",
"body": "Hi, is the blue kurta available in medium?",
"status": "received",
"error": null,
"media": null,
"sender": null,
"at": "2026-01-31 09:30:00",
"time": "3:00 pm",
"day": "31 Jan 2026"
},
"conversation_id": 2001,
"contact_id": 1001,
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"conversation": {
"id": 2001,
"contact_id": 1001,
"channel": "whatsapp",
"status": "open",
"assigned_to": null,
"last_message_preview": "Hi, is the blue kurta available in medium?",
"last_message_at": "2026-01-31T09:30:00Z",
"window_open": true,
"created_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/inbox?c=2001"
}
}
}conversation.openedA conversation starts or is reopenedWithin about a minute
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "conversation.opened",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"conversation": {
"id": 2001,
"contact_id": 1001,
"channel": "whatsapp",
"status": "open",
"assigned_to": null,
"last_message_preview": "Hi, is the blue kurta available in medium?",
"last_message_at": "2026-01-31T09:30:00Z",
"window_open": true,
"created_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/inbox?c=2001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"reason": "new"
}
}conversation.closedA conversation is closedWithin about a minute
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "conversation.closed",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"conversation": {
"id": 2001,
"contact_id": 1001,
"channel": "whatsapp",
"status": "closed",
"assigned_to": null,
"last_message_preview": "Hi, is the blue kurta available in medium?",
"last_message_at": "2026-01-31T09:30:00Z",
"window_open": true,
"created_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/inbox?c=2001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}conversation.handoverA chatbot hands a chat to the teamWithin about a minute
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "conversation.handover",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"conversation": {
"id": 2001,
"contact_id": 1001,
"channel": "whatsapp",
"status": "open",
"assigned_to": null,
"last_message_preview": "Hi, is the blue kurta available in medium?",
"last_message_at": "2026-01-31T09:30:00Z",
"window_open": true,
"created_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/inbox?c=2001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}Contacts and leads
contact.createdA new contact is addedStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "contact.created",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}contact.updatedA contact’s details are changedStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "contact.updated",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"changed": [
"name"
]
}
}contact.tag_addedA tag is added to a contactWithin about a minute
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "contact.tag_added",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"tag": {
"id": 11,
"name": "New customer"
}
}
}lead.createdA new lead arrives from an adWithin about a minute
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "lead.created",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"lead": {
"id": 5001,
"contact_id": 1001,
"conversation_id": 2001,
"source_type": "ad",
"ad_id": "120210000000000001",
"headline": "Festive dresses, 20% off",
"body": "Tap to chat with us on WhatsApp.",
"source_url": "https://fb.me/example",
"created_at": "2026-01-31T09:30:00Z"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"conversation_id": 2001
}
}Broadcasts
campaign.finishedA broadcast finishesWithin about a minute
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "campaign.finished",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"campaign": {
"id": 4001,
"name": "Festive offer",
"status": "completed",
"total": 250,
"sent": 247,
"delivered": 240,
"read": 180,
"failed": 3,
"replied": 21,
"note": null,
"started_at": "2026-01-31T09:15:00Z",
"completed_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/campaigns/4001",
"template_id": 12,
"number_id": 1,
"scheduled_at": null,
"created_at": "2026-01-31T09:15:00Z"
}
}
}Orders
order.createdA customer places an order in chatStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "order.created",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"order": {
"id": 6001,
"number": 1042,
"status": "awaiting_payment",
"total": 499800,
"currency": "INR",
"contact_id": 1001,
"conversation_id": 2001,
"subtotal": 499800,
"source": "chat",
"payment_provider": "razorpay",
"payment_url": "https://rzp.io/i/example",
"payment_id": null,
"items": [
{
"product_id": 301,
"name": "Linen dress",
"sku": "KS-01",
"price": 249900,
"quantity": 2,
"total": 499800
}
],
"created_at": "2026-01-31T09:30:00Z",
"paid_at": null,
"fulfilled_at": null,
"cancelled_at": null,
"url": "https://chatilo.me/orders/6001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}order.paidAn order is paidStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "order.paid",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"order": {
"id": 6001,
"number": 1042,
"status": "paid",
"total": 499800,
"currency": "INR",
"contact_id": 1001,
"conversation_id": 2001,
"subtotal": 499800,
"source": "chat",
"payment_provider": "razorpay",
"payment_url": "https://rzp.io/i/example",
"payment_id": "pay_Example123",
"items": [
{
"product_id": 301,
"name": "Linen dress",
"sku": "KS-01",
"price": 249900,
"quantity": 2,
"total": 499800
}
],
"created_at": "2026-01-31T09:30:00Z",
"paid_at": "2026-01-31T09:30:00Z",
"fulfilled_at": null,
"cancelled_at": null,
"url": "https://chatilo.me/orders/6001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}order.fulfilledAn order is marked fulfilledStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "order.fulfilled",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"order": {
"id": 6001,
"number": 1042,
"status": "fulfilled",
"total": 499800,
"currency": "INR",
"contact_id": 1001,
"conversation_id": 2001,
"subtotal": 499800,
"source": "chat",
"payment_provider": "razorpay",
"payment_url": "https://rzp.io/i/example",
"payment_id": "pay_Example123",
"items": [
{
"product_id": 301,
"name": "Linen dress",
"sku": "KS-01",
"price": 249900,
"quantity": 2,
"total": 499800
}
],
"created_at": "2026-01-31T09:30:00Z",
"paid_at": "2026-01-31T09:30:00Z",
"fulfilled_at": "2026-01-31T09:30:00Z",
"cancelled_at": null,
"url": "https://chatilo.me/orders/6001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}order.cancelledAn order is cancelledStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "order.cancelled",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"order": {
"id": 6001,
"number": 1042,
"status": "cancelled",
"total": 499800,
"currency": "INR",
"contact_id": 1001,
"conversation_id": 2001,
"subtotal": 499800,
"source": "chat",
"payment_provider": "razorpay",
"payment_url": "https://rzp.io/i/example",
"payment_id": "pay_Example123",
"items": [
{
"product_id": 301,
"name": "Linen dress",
"sku": "KS-01",
"price": 249900,
"quantity": 2,
"total": 499800
}
],
"created_at": "2026-01-31T09:30:00Z",
"paid_at": "2026-01-31T09:30:00Z",
"fulfilled_at": null,
"cancelled_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/orders/6001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}Bookings
booking.createdAn appointment is bookedStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "booking.created",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"booking": {
"id": 7001,
"ref": "BK-7Q2M",
"status": "confirmed",
"service_id": 3,
"service": "Bridal consultation",
"staff_id": 2,
"staff": "Anu",
"contact_id": 1001,
"conversation_id": 2001,
"customer_name": "Grace Miller",
"starts_at": "2026-02-02T09:30:00Z",
"ends_at": "2026-02-02T10:15:00Z",
"local_start": "2026-02-02T15:00",
"timezone": "Asia/Kolkata",
"duration_minutes": 45,
"price": 50000,
"currency": "INR",
"source": "whatsapp",
"notes": null,
"cancel_reason": null,
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/bookings/7001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}booking.rescheduledAn appointment is moved to a new timeStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "booking.rescheduled",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"booking": {
"id": 7001,
"ref": "BK-7Q2M",
"status": "confirmed",
"service_id": 3,
"service": "Bridal consultation",
"staff_id": 2,
"staff": "Anu",
"contact_id": 1001,
"conversation_id": 2001,
"customer_name": "Grace Miller",
"starts_at": "2026-02-02T09:30:00Z",
"ends_at": "2026-02-02T10:15:00Z",
"local_start": "2026-02-02T15:00",
"timezone": "Asia/Kolkata",
"duration_minutes": 45,
"price": 50000,
"currency": "INR",
"source": "whatsapp",
"notes": null,
"cancel_reason": null,
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/bookings/7001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
},
"previous_starts_at": "2026-02-01T09:30:00Z"
}
}booking.cancelledAn appointment is cancelledStraight away
{
"id": "evt_3f9a1c0b7d2e4a5f6b8c9d0e",
"event": "booking.cancelled",
"created_at": "2026-01-31T09:30:00+00:00",
"data": {
"booking": {
"id": 7001,
"ref": "BK-7Q2M",
"status": "cancelled",
"service_id": 3,
"service": "Bridal consultation",
"staff_id": 2,
"staff": "Anu",
"contact_id": 1001,
"conversation_id": 2001,
"customer_name": "Grace Miller",
"starts_at": "2026-02-02T09:30:00Z",
"ends_at": "2026-02-02T10:15:00Z",
"local_start": "2026-02-02T15:00",
"timezone": "Asia/Kolkata",
"duration_minutes": 45,
"price": 50000,
"currency": "INR",
"source": "whatsapp",
"notes": null,
"cancel_reason": "Customer asked to cancel",
"cancelled_by": "customer",
"cancelled_at": "2026-01-31T09:30:00Z",
"created_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z",
"url": "https://chatilo.me/bookings/7001"
},
"contact": {
"id": 1001,
"name": "Grace Miller",
"phone": "919876543210",
"email": "[email protected]",
"source": "whatsapp",
"opted_in": true,
"tags": [
"New customer"
],
"created_at": "2026-01-31T09:30:00Z",
"attributes": {
"city": "Denver"
},
"notes": "",
"opted_out_at": null,
"last_seen_at": "2026-01-31T09:30:00Z",
"updated_at": "2026-01-31T09:30:00Z"
}
}
}A few details worth knowing:
message.receivedis sent for every message a customer sends, on every channel. Messages you send do not raise an event; ask GET /messages/{id} for their status.contact.updatedlists what changed inchanged. It is sent for changes through the API and edits on the contact page.conversation.openedhas areason:newfor a first message,reopenedwhen a customer writes into a closed chat.conversation.handovermeans a chatbot, a flow or the AI assistant passed the chat to the team.order.cancelleddoes not mean a refund was made: refunds happen in your own payment account.booking.rescheduledcarries the old start time asprevious_starts_at.- New fields can be added to any payload at any time. Ignore the ones you don’t use.
Testing #
You can build your receiver before anything real has happened. GET /sample/{event} returns example deliveries for any event, made from your workspace’s own recent data where there is some:
curl "https://chatilo.me/api/v1/sample/order.paid" \
-H "Authorization: Bearer YOUR_API_KEY"To see real deliveries while developing on your own computer, use a tunnel that gives your machine a public https address, subscribe that address, then cause the event: send your business’s number a WhatsApp message, or add a contact.