We recommend to read through Webhooks overview and Setting up webhooks articles before you proceed with this one.
Currently, you can subscribe to chat, customer, and message events only. Feel free to chat us with your feedback on the missing events you'd like to use.
All webhook events contain the same attributes, listed below.
Field | Type | Description |
event | String | Chat or customer event type |
eventData | Object | A container for the data associated with the event |
attempts | Integer | Number of times this event has been attempted |
lastAttemptAt | Date (UNIX timestamp) | The last time the event delivery was attempted |
createdAt | Date (UNIX timestamp) | Date and time the event was created |
id | String | Unique event id provided by HelpCrunch |
📢 Message Events
Event Type | Description |
message.chat.customer | New incoming chat message sent by a customer |
message.email.customer | New incoming email message sent by a customer |
message.private | New private message sent by a team member |
message.chat.agent | New chat message sent by a team member |
message.email.agent | New email message sent by a team member |
When the message event occurs, HelpCrunch sends the HTTP request to the specified endpoint. You can extract all the available message attributes from the eventData
structure in the request body, including basic information about the customer (id, name, email and userId) and chat (id).
Message Model for Webhooks
Example Response
{
"event": "message.chat.customer",
"eventData": {
"chat_id": 5224081,
"agent": null,
"customer": {
"id": 8745474,
"name": "Paul",
"email": "[email protected]",
"userId": "example_9106"
},
"message": {
"applicationId": 77,
"broadcastType": null,
"createdAt": "1638953586.915",
"edited": false,
"id": 38488,
"read": false,
"text": "Thanks! Have a nice day.",
"updatedAt": "1638953586.915"
}
},
"attempts": 0,
"lastAttemptAt": 1638953588,
"createdAt": 1638953588,
"id": "73499e69-285c-44c3-8431-a843ed08183d"
}
eventData
Object for Message Events
Field | Type | Description |
event | String | Event type |
chat_id | Integer | Unique internal chat id |
agent | Object |
Team member info, including:
|
customer | Object |
Basic customer info, including:
|
message | Object |
Message information, including:
|
If you have any questions regarding our Webhooks, feel free to chat us any time.
👩💻 Happy Coding! 👨💻