Hello 👋🏼 How can we help?

Webhook event types & models

Complete list of all webhook events you can subscribe to
Written by Konstantine
Updated 4 months ago

We recommend to read through Webhooks overview and Setting up webhooks articles before you proceed with this one.

Currently, you can subscribe to chat and customer 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

💬 Chat Events

Event Type Description
chat.new New chat created by any customer
chat.status_updated Chat status updated either manually or automatically (e.g when agent replies to a New chat and the status automatically changes to Opened)
chat.assigned Chat assignee updated either manually or automatically (e.g when agent replies and auto-assigns the chat to themselves)
chat.snoozed Chat snoozed for later
chat.unsnoozed Chat unsnoozed
chat.closed Chat closed by agent or by customer
chat.rated Chat rated by customer

When the chat event occurs, HelpCrunch sends the HTTP request to the specified endpoint. You can extract all the available chat attributes from the eventData structure in the request body, including basic information about the customer (id, name, email and userId).

You can use chat id and customer id from any chat event to call Get a single chat and Get a single customer REST API methods.


Chat Model for Webhooks

Example Response

{
    "event": "chat.snoozed",
    "eventData": {
      "communicatedAgents": [
        2924
      ],
      "customer": {
        "id": 8745474,
        "name": "Paul",
        "email": "paul.hunter@example.com",
        "userId": "example_9106"
      },
      "closedBy": "customer",
      "status": "closed",
      "closedAt": "1607542030.713",
      "rating": "great",
      "createdAt": "1607540767.414",
      "snoozedUntil": "1606155714.000",
      "applicationId": 89,
      "department": {
        "id": 233231,
        "name": "Sales"
      },
      "lastCustomerMessageAt": "1607540767.166",
      "chat_id": 5224081,
      "assignee": {
        "id": 2924,
        "name": "Paul",
        "email": "pavel@helpcrunch.com",
        "role": "admin"
      },
      "lastMessage": {
        "id": 9685301,
        "text": "set_rating",
        "createdAt": "1607542030.679"
      }
    },
    "attempts": 0,
    "lastAttemptAt": 1607542030,
    "createdAt": 1607542030,
    "id": "252041ed-62a7-4303-81f9-842ec6e8d18f"
  }

eventData Object for Chat Events

Field Type Description
event String Event type
communicatedAgents Array of integers Array of agent id's. You can fetch agents' info (id, name, email, role) with Get all team members REST API method.
customer Object Basic customer info, including unique HelpCrunch id, name, email and userId (defined on your side).
closedBy String "customer" or "agent". Who closed the chat
closedAt Date (UNIX timestamp) Date and time the chat was closed
status String Current chat status: "new", "open", "pending", "on-hold", "closed", "no communication", "empty".
rating String Chat rating for closed chats: "poor",  "average" or "great"
createdAt Date (UNIX timestamp) Date and time the chat was created
snoozedUntil Date (UNIX timestamp) Date and time the chat was snoozed until
applicationId Integer Unique id of the application provided by HelpCrunch. You can fetch application info (id, name, active, type) with Get all applications REST API method
department Object Department the chat is currently assigned to. Consists of unique HelpCrunch id and name.
lastCustomerMessageAt Date (UNIX timestamp) Date and time of the last message from customer
chat_id Integer Unique id of the chat provided by HelpCrunch
assignee Object Agent the chat is currently assigned to. Consists of unique HelpCrunch id, name, email and role.
lastMessage Object Information about the last message in the chat. Consists of unique HelpCrunch id, text and createdAt date. If the last message was sent from agent, the object will contain the id of that agent as well.

🙋 Customer Events

Event Type Description
customer.new New customer added to your HelpCrunch account
customer.email_updated Customer email updated. Changing to null value is considered as update.
customer.tags_changed Customer's tags changed. Removing all tags is considered as update.
customer.unsubscribed Customer unsubscribed from your emails
customer.subscribed Customer subscribed to your emails
customer.blocked Customer blocked by any of your team members
customer.unblocked Customer unblocked by any of your team members
customer.deleted Customer deleted from your HelpCrunch account

When the customer event occurs, HelpCrunch sends the HTTP request to the specified endpoint. You can extract basic customer information from the eventData structure in the request body (id, name, email, userId, unsubscribed) as well as all of your Custom Data attributes.

In order to get all the available customer data, use customer id from the event and call Get a single customer REST API method.


Customer Model for Webhooks

Example Response

{
    "event": "customer.email_updated",
    "eventData": {
      "id": 8745474,
      "name": "Paul",
      "userId": "example_2924",
      "email": "paul@example.com",
      "unsubscribed": false,
      "customData": {
          "Role": "admin",
          "Plan": "Enterprise (Unlimited) $9999/mo",
          "segment": "PotentialChurn_premium_seg1",
          "Currency": "USD",
          "Emails sent": 621,
          "Trial end date": "2017-07-24 14:30:00",
          "Became payer at": "2017-09-13 00:00:00",
          "Registered date": "2017-07-10 14:30:00",
          "Next payment date": "2020-09-01 00:40:00",
          "Billing info added": true,
          "Number of payments": 35,
          "Subscription status": "active"
      },
      "tags": [
          {
              "id": 52661,
              "name": "Lead"
          },
          {
              "id": 64814,
              "name": "Enterprise"
          }
      ],
    },
    "attempts": 0,
    "lastAttemptAt": 1606151791,
    "createdAt": 1606151791,
    "id": "9e7ef91a-6243-4637-b5d2-404b68841ee9"
}

eventData Object for Customer Events

Field Type Description
event String Event type
id Integer Unique id of the customer provided by HelpCrunch
name String Customer's name 
userId String Unique id of the customer that you can pass to HelpCrunch with User Authentication
email String Customer's email
unsubscribed Boolean Customer email subscription status. True - unsubscribed. False - subscribed.
customData Array Your Custom Data presented as an array. Each attribute consists of name/property and value.
tags Array Array of tag objects. Each tag contains it's unique HelpCrunch id and name.

If you have any questions regarding our Webhooks, feel free to chat us any time. 

👩‍💻 Happy Coding! 👨‍💻

Did this answer your question?