SectionFor developers
Receive chat events via webhooks
In this article
A webhook is a request the chat sends to your address by itself when something happens: a new message, a new conversation, a customer left their email. That way data reaches your CRM or spreadsheet without polling the API.
You need an address on your server that accepts POST requests with JSON.
Set up
- Open “Settings” → “Miscellaneous” → “Webhooks”.
- Turn on “Active”.
- In the “URL” field, paste the address that will receive the requests.
- In “Secret key”, enter any string — it will come in every request so you can check the request is from the chat.
- In “Active webhooks”, list the events you need, separated by commas, e.g. message-sent,new-email-address. An empty field means all events are sent.
- Click “Save changes”.
Request format
The chat sends a POST with the Content-Type: application/json header. The body contains the event name, your key and the event data:
{
"function": "message-sent",
"key": "YOUR_SECRET_KEY",
"data": {
"user_id": 45,
"message_id": 1024,
"message": "Hi! Do you deliver to Lviv?",
"attachments": [],
"conversation_user_id": 45,
"conversation_id": 310,
"conversation_status_code": 2,
"conversation_source": "tg"
},
"sender-url": ""
}Check the key field: if it doesn’t match your secret key, the request isn’t from the chat.
Events
- message-sent
- A message was sent in a conversation: by the customer, a manager or the AI agent.
- new-messages
- The widget or dashboard received new messages.
- bot-message
- The event name is reserved, but the chat doesn’t send it right now. AI agent replies come as message-sent.
- new-conversation-created
- A new conversation was created.
- new-conversation
- The widget or dashboard received a new conversation.
- conversation-status-updated
- A conversation’s status changed.
- message-deleted
- A message was deleted.
- login
- The customer signed in via the chat’s login form.
- registration
- The customer filled in the registration form.
- user-deleted
- A customer was deleted.
- new-email-address
- The customer left an email in the chat.
- rich-message
- The customer submitted a form or a button in a message.
- email-sent
- An email was sent.
- sms-sent
- An SMS was sent.
- slack-message-sent
- A message was sent to Slack.
How to check
In “URL”, enter a test address that shows incoming requests, and write in the chat on your site. A message-sent request should arrive.
If it doesn’t work
- No requests arrive at all
- Check “Active” and “URL”. The address must be reachable from the internet.
- Not all events arrive
- In “Active webhooks”, event names must match the list above. Or clear the field.
- new-messages and new-conversation arrive irregularly
- These events are sent by an open widget or dashboard page. For reliable message tracking, use message-sent.
There are no order or cart events among the webhooks. The chat sends each request once and doesn’t retry if your server didn’t respond.