Webhooks
Webhooks let you receive real-time HTTP notifications when events happen in your chatbots. Instead of polling the API, Conferbot pushes data to your endpoint as events occur.
How It Works
- You register a webhook URL and select events to subscribe to.
- When an event occurs, Conferbot sends a
POSTrequest to your URL with a signed JSON payload. - Your server verifies the HMAC-SHA256 signature and processes the event.
- If delivery fails, Conferbot retries up to 3 times with exponential backoff.
Event Types
Subscribe to one or more of the following events:
| Event | Description | Triggered When |
|---|---|---|
response.created | New chatbot response | A visitor submits a response in a chatbot conversation |
response.updated | Response updated | A chatbot response record is modified (e.g., additional data captured) |
conversation.started | Conversation begins | A new chat session is initiated by a visitor |
conversation.completed | Conversation ends | A chat session is marked as complete |
message.created | New message in a chat | A visitor, the bot, the AI or an agent sends a message in a live chat (website widget or a connected channel). Carries the text and sender, about a second after it happens |
Payload Format
Webhook payloads are sent as JSON in the POST request body. Each payload includes the event type, resource IDs, and a timestamp. Events from live chats also carry the visitor's details: IP address, location, device, the page the chat started on and the answers the visitor gave.
Headers
Every webhook delivery includes these headers:
| Header | Description |
|---|---|
x-webhook-signature | HMAC-SHA256 hex digest of the raw request body, keyed with your webhook secret. Bare hex - no sha256= prefix. |
x-webhook-event | The event type (e.g., response.created) |
x-webhook-timestamp | Unix epoch timestamp in milliseconds of when the delivery was sent (e.g. 1734255000000) |
Content-Type | application/json |
User-Agent | Conferbot-Webhooks/1.0 |
Example payload - response.created
{
"event": "response.created",
"chatSessionId": "sess_abc123def456",
"responseId": "65a1b2c3d4e5f6a7b8c9d0e1",
"botId": "64f8a2b3c1d4e5f6a7b8c9d0",
"visitorId": "visitor_xyz789",
"channel": "web",
"visitor": { "id": "visitor_xyz789", "ip": "203.0.113.7", "location": { "city": "Bengaluru", "country": "India" } },
"timestamp": "2024-12-15T09:30:00.000Z"
}Example payload - response.updated
{
"event": "response.updated",
"responseId": "65a1b2c3d4e5f6a7b8c9d0e1",
"botId": "64f8a2b3c1d4e5f6a7b8c9d0",
"chatSessionId": "sess_abc123def456",
"timestamp": "2024-12-15T09:35:00.000Z"
}Example payload - conversation.started
{
"event": "conversation.started",
"chatSessionId": "sess_abc123def456",
"responseId": "65a1b2c3d4e5f6a7b8c9d0e1",
"botId": "64f8a2b3c1d4e5f6a7b8c9d0",
"chatbotName": "Support Bot",
"visitorId": "visitor_xyz789",
"channel": "web",
"visitor": {
"id": "visitor_xyz789",
"email": "[email protected]",
"ip": "203.0.113.7",
"location": {
"city": "Bengaluru",
"region": "Karnataka",
"country": "India",
"countryCode": "IN",
"postalCode": "560001",
"timezone": "Asia/Kolkata",
"latitude": 12.97,
"longitude": 77.59
},
"isp": "AS9829 BSNL",
"language": "en-IN,en;q=0.9",
"device": {
"type": "mobile",
"browser": "Mobile Safari",
"browserVersion": "17.0",
"os": "iOS",
"osVersion": "17.0",
"model": "iPhone",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) ..."
}
},
"page": {
"url": "https://example.com/pricing",
"landingPage": "https://example.com/",
"referrer": "https://www.google.com/",
"utm": { "source": "google", "campaign": "spring" },
"visits": 3
},
"variables": { "email": "[email protected]", "budget": 5000 },
"customData": { "plan": "pro", "accountId": "acc_42" },
"timestamp": "2024-12-15T09:30:00.000Z"
}Example payload - message.created
{
"event": "message.created",
"chatSessionId": "sess_abc123def456",
"responseId": "65a1b2c3d4e5f6a7b8c9d0e1",
"botId": "64f8a2b3c1d4e5f6a7b8c9d0",
"visitorId": "visitor_xyz789",
"channel": "web",
"message": {
"id": "sess_abc123def456:3",
"sequence": 3,
"sender": "visitor",
"type": "text",
"text": "Where is my order?",
"sentAt": "2024-12-15T09:31:12.000Z"
},
"visitor": { "id": "visitor_xyz789", "ip": "203.0.113.7", "location": { "city": "Bengaluru", "country": "India" } },
"page": { "url": "https://example.com/pricing" },
"timestamp": "2024-12-15T09:31:13.000Z"
}message.idis stable: deliveries are at-least-once, so use it to skip a message you already have.senderisvisitor,bot,aioragent. Agent messages addsenderName; files addattachments(url,name,contentType). Bot text can contain simple HTML.- Sort by
sequence: events are not guaranteed to arrive in order. - A reply you send through the API comes back with
"source": "api", so you can skip your own echo. - Private agent notes and activity lines (agent joined, chat closed) are never sent.
Example payload - conversation.completed
{
"event": "conversation.completed",
"chatSessionId": "sess_abc123def456",
"botId": "64f8a2b3c1d4e5f6a7b8c9d0",
"resolution": "escalated",
"escalationReason": "user_requested_human",
"duration": 182,
"turnCount": 6,
"timestamp": "2024-12-15T10:00:00.000Z"
}Payload fields
- For live chats (website widget and channels),
conversation.completedincludesendedBy(bot,agent,ai,visitor) and the visitor's details, and is sent once per conversation. - For AI agent conversations,
conversation.completedincludes aresolutionfield:"escalated"(handed off to agent, with anescalationReason),"resolved", or"ended"- plusdurationandturnCount. conversation.startedincludes thechannel(web,whatsapp, etc.) and thechatbotName(AI-agent conversations send anaiAgentname instead).
Visitor Details
Every live chat event (conversation.started, response.created, message.created, response.updated and conversation.completed) says who the visitor is and where they came from, read at the moment the event is sent. Anything that isn't known is left out, so treat every field as optional.
| Field | What it holds |
|---|---|
visitor.id | The visitor ID (the same as visitorId) |
visitor.name, email, phone | Once the chat has them: from the bot's questions, the channel profile or the signed-in user your site passed in |
visitor.ip | The visitor's IP address, from their connection |
visitor.location | city, region, country, countryCode, postalCode, timezone, latitude, longitude. Looked up from the IP address, so city-level, not GPS |
visitor.isp | The network the visitor is on |
visitor.language | The browser's language preference |
visitor.device | type (mobile, tablet, desktop), browser, browserVersion, os, osVersion, model, userAgent |
visitor.identityVerified, verifiedUserId | When your site signs the visitor's ID (identity verification) |
visitor.contactId | The visitor's contact in Conferbot |
visitor.platformUserId, platformUsername | The WhatsApp, Telegram, Messenger... user, on channel chats |
page | url (where the chat started), landingPage, exitPage, referrer, utm (source, medium, campaign, term, content), adNetwork, firstSeenAt, visits |
variables | The answers your bot's flow collected, by variable name |
customData | What your website passed to the widget in user and customData (up to 4 KB) |
You don't need to collect the IP address or location yourself: Conferbot reads them from the visitor's connection when the chat starts. conversation.started waits up to about three seconds for them and always arrives before the conversation's first message.created. To send your own data along (a user ID, a plan), pass it when you load the widget:
window.ConferbotWidget("YOUR_BOT_ID", "live_chat", {
user: { id: "u_123", name: "Jane Doe", email: "[email protected]" },
customData: { accountId: "acc_42", plan: "pro" },
});Reply From Your Product
With message.created you can show live chats in your own app. To answer one, send the reply with an API key that has the conversations:write scope, using the bot ID and chatSessionId from the event. The visitor sees it like a reply from the inbox: in the website widget, or on WhatsApp, Telegram and the other connected channels.
curl -X POST "https://api-v2.conferbot.com/api/v1/external/v1/chatbots/BOT_ID/conversations/CHAT_SESSION_ID/messages" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Thanks! Your order ships today.", "agentName": "Maya"}'See Send a message to a conversation for the responses and errors.
Signature Verification
Every webhook delivery is signed with your webhook's secret using HMAC-SHA256. Always verify the signature before processing the payload to ensure it came from Conferbot and hasn't been tampered with.
Verification steps
- Read the raw request body (before JSON parsing).
- Compute the HMAC-SHA256 hex digest using your webhook secret as the key.
- Compare it to the
x-webhook-signatureheader value. The header is the bare hex digest - there is nosha256=prefix. - Use timing-safe comparison to prevent timing attacks.
const crypto = require("crypto");
// Use raw body parser for webhook routes
app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
const signature = req.headers["x-webhook-signature"];
const event = req.headers["x-webhook-event"];
// Compute expected signature (bare hex, no "sha256=" prefix)
const expected = crypto
.createHmac("sha256", WEBHOOK_SECRET)
.update(req.body) // raw Buffer
.digest("hex");
// Timing-safe comparison (length check first: timingSafeEqual
// throws when buffer lengths differ)
const isValid =
typeof signature === "string" &&
signature.length === expected.length &&
crypto.timingSafeEqual(
Buffer.from(signature, "hex"),
Buffer.from(expected, "hex")
);
if (!isValid) {
return res.status(401).send("Invalid signature");
}
// Parse and process the event
const payload = JSON.parse(req.body);
console.log(`Received ${event}:`, payload);
// Respond with 200 to acknowledge receipt
res.status(200).send("OK");
});Never skip verification
Always verify the x-webhook-signature header. Without verification, anyone can send fake events to your endpoint. Use timing-safe comparison to prevent timing attacks.
Retries & Failure Handling
If your endpoint doesn't respond with a 2xx status code within 10 seconds, Conferbot considers the delivery failed and retries:
| Attempt | Delay | Notes |
|---|---|---|
| 1st retry | 30 seconds | First automatic retry |
| 2nd retry | 2 minutes | Second retry with longer delay |
| 3rd retry | 8 minutes | Final retry attempt |
Auto-disable
If a webhook accumulates 10 consecutive failures, it is automatically set to failed status and stops receiving events. You can reactivate it from the dashboard or API after fixing the issue.
Best practices
Respond with 200 OK immediately and process the event asynchronously. This prevents timeouts when your processing takes more than 10 seconds.
Delivery logs
Every delivery attempt is logged with status code, response time, and error details. Logs are retained for 30 days and viewable in the dashboard at Workspace → Webhooks. The External API does not currently expose a delivery-log endpoint.
Webhook Management API
Create, update, and delete webhooks programmatically. All endpoints require an x-api-key header.
Create Webhook
Target URL must be https://. We reject http://,javascript:, file:, localhost, and any private / loopback / link-local IP (defense in depth against SSRF).
POST /api/v1/external/v1/webhooks
Content-Type: application/json
{
"chatbotId": "64f8a2b3c1d4e5f6a7b8c9d0",
"url": "https://example.com/webhook",
"events": ["response.created", "conversation.completed"],
"description": "CRM integration"
}{
"data": {
"id": "65b2c3d4e5f6a7b8c9d0e1f2",
"chatbot": { "id": "64f8a2b3c1d4e5f6a7b8c9d0", "name": null },
"url": "https://example.com/webhook",
"events": ["response.created", "conversation.completed"],
"description": "CRM integration",
"status": "active",
"failureCount": 0,
"lastDeliveryAt": null,
"lastFailureAt": null,
"createdAt": "2025-01-15T09:30:00.000Z",
"updatedAt": "2025-01-15T09:30:00.000Z",
"secret": "a1b2c3d4...64-char-hex-string"
},
"message": "Save the secret — it won't be shown again."
}Save your secret
The secret is returned only at creation time. Copy it immediately. If lost, delete the webhook and create a new one - there is no rotate-in-place endpoint on the External API.
List Webhooks
GET /api/v1/external/v1/webhooksUpdate Webhook
Partial update. The signing secret is preserved across all fields you change. Allowed fields: url, events, description, and status (active ↔ paused).
PATCH /api/v1/external/v1/webhooks/:webhookId
Content-Type: application/json
{
"url": "https://new-endpoint.example.com/hook",
"events": ["response.created"],
"status": "paused",
"description": "Updated integration"
}Delete Webhook
Deleting the parent chatbot also deletes all of its webhooks (cascade), so you usually don't need to call this explicitly when retiring a bot.
DELETE /api/v1/external/v1/webhooks/:webhookIdWebhook Status
| Status | Description |
|---|---|
active | Receiving events normally |
paused | Manually paused by admin - no events delivered |
failed | Auto-disabled after 10 consecutive failures. Reactivate from the dashboard or API. |
Plan Limits
| Plan | Max Webhooks |
|---|---|
| Free | No webhook access |
| Starter | 5 |
| Pro | 15 |
| Business | 50 |
| Enterprise | Unlimited |
Testing Webhooks
Use a service like webhook.site or RequestBin to test webhooks without setting up your own server:
- Go to webhook.site and copy your unique URL.
- Create a webhook in your Conferbot dashboard using that URL.
- Trigger an event (e.g., submit a chatbot response).
- Check webhook.site to see the payload and headers.