Documentation Index
Fetch the complete documentation index at: https://docs.kaanha.ai/llms.txt
Use this file to discover all available pages before exploring further.
Webhooks
Kaanha AI can send real-time event notifications to your server via outgoing webhooks. This allows you to integrate with any backend system, CRM, or automation tool.
Setting Up a Webhook
-
Go to Integrations → Webhooks → Add Webhook
-
Enter:
- Name: Descriptive label (e.g., “CRM Sync”)
- URL: Your server endpoint (must be HTTPS, publicly accessible)
- Events: Select which events to subscribe to
- Secret: Optional — used for HMAC signature verification
-
Click Save. Kaanha AI will immediately send a test event.
Event Types
| Event | Trigger |
|---|
message.received | Contact sends you a message |
message.sent | You send a message |
message.delivered | Message delivered to device |
message.read | Message read by contact |
conversation.opened | New conversation created |
conversation.resolved | Conversation marked resolved |
contact.created | New contact added |
contact.updated | Contact profile updated |
contact.opted_out | Contact sent STOP / unsubscribed |
broadcast.completed | Broadcast finishes sending |
payment.completed | Payment link paid |
All events are delivered as POST requests with Content-Type: application/json.
Example: message.received
{
"event": "message.received",
"organizationId": "clx...",
"timestamp": "2026-03-24T10:30:00.000Z",
"data": {
"messageId": "wamid.xxx",
"conversationId": "clx...",
"contact": {
"id": "clx...",
"phone": "+919876543210",
"name": "John Doe",
"tags": ["vip"]
},
"message": {
"type": "text",
"text": "Hi, I need help with my order",
"timestamp": "2026-03-24T10:29:58.000Z"
}
}
}
{
"event": "contact.created",
"organizationId": "clx...",
"timestamp": "2026-03-24T10:30:00.000Z",
"data": {
"contact": {
"id": "clx...",
"phone": "+919876543210",
"name": "Jane Smith",
"email": "jane@example.com",
"tags": [],
"optedIn": true,
"createdAt": "2026-03-24T10:30:00.000Z"
}
}
}
HMAC Signature Verification
If you set a Secret on your webhook, Kaanha AI signs every request with HMAC-SHA256.
The signature is sent in the X-Kaanha-Signature header:
X-Kaanha-Signature: sha256=abc123...
Verification Example (Node.js)
const crypto = require('crypto');
function verifyWebhook(rawBody, signature, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// Express middleware
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['x-kaanha-signature'];
if (!verifyWebhook(req.body, sig, process.env.WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(req.body);
console.log('Event:', event.event);
res.status(200).send('OK');
});
Retry Policy
If your server returns a non-2xx response, Kaanha AI retries with exponential backoff:
| Attempt | Delay |
|---|
| 1st retry | 5 seconds |
| 2nd retry | 25 seconds |
| 3rd retry | 2 minutes |
After 3 failed attempts, the delivery is marked as failed and logged.
Webhook Logs
View delivery history for each webhook in Integrations → Webhooks → [Name] → Logs:
| Column | Description |
|---|
| Timestamp | When the delivery was attempted |
| Event | Event type |
| Status | delivered / failed / pending |
| Response Code | HTTP status from your server |
| Duration | Round-trip time in ms |
Zapier / Make / n8n Integration
Kaanha AI supports direct integration with no-code automation platforms.
Discovery endpoint (for custom apps):
GET https://app.kaanha.ai/api/integrations/describe
Authorization: Bearer YOUR_API_KEY
Returns all available triggers and actions for platform discovery.
For Zapier: use the Webhooks by Zapier trigger with your Kaanha AI webhook URL.
For Make (Integromat): use the Webhooks module.