Webhook events

Channel currently provides only one event, message creation. We plan to add more events later on.

Event structure

When a particular event occurs, we request a POST call to your registered URL with a body with JSON format data. An event JSON format is the following:

  • event: describes an action of the event such as "upsert", "update" and "push".
  • type: a model that is a target of the event. For now, “Message”, “UserChat” and "User".
  • entity: an actual model data for the type.
  • refers: includes objects if there are more models that have to be addressed

New message

Webhook will notify when a message was created in chat (team or user chat). If you registered keywords in Webhook, we will notify you only when a new message contains one of your keywords.
An entity of the request body will be a Message object.

  • chatType of Message : "group" or "userChat"
  • personType of Message : "manager" or "bot" or "user"

With this event, you can create a chatbot that responds to a certain message.
If you want, you can use our Quick-reply option.

{
   "event":"push",
   "type":"message",
   "entity":{
      "chatKey": "string",
      "id": "string",
      "mainKey": "string",
      "threadKey": "string",
      "root": Boolean,
      "channelId": "string",
      "chatType": "string",
      "chatId": "string",
      "personType": "string",
      "personId": "string",
      "requestId": "string",
      "language": "string",
      "createdAt": 1624414655810,
      "version": 0,
      "blocks": [
        {
          "type": "text",
          "value": "string"
        }
      ],
      "plainText": "string",
      "updatedAt": 1624414655811,
      "buttons": [
        {
          "title": "string",
          "colorVariant": "string",
          "url": "string"
        }
      ],
      "reactions": [
        {
          "emojiName": "string",
          "personKeys": [
            "string"
          ]
        }
      ],
      "state": "string",
      "marketing": {
        "type": "string",
        "id": "string",
        "advertising": Boolean,
        "exposureType": "string"
      },
      "supportBot": {
        "id": "string",
        "revisionId": "string",
        "sectionId": "string",
        "stepIndex": 0,
        "buttons": [
          {
            "text": "string",
            "nextSectionId": "string"
          }
        ],
        "submitButtonIndex": 0
      },
      "threadMsg": Boolean,
      "broadcastedMsg": Boolean,
      "rootMessageId": "string"
   },
   "refers":{
      "manager":{
        "id": "string",
        "channelId": "string",
        "accountId": "string",
        "username": "string",
        "name": "string",
        "description": "string",
        "email": "string",
        "mobileNumber": "string",
        "role": "string",
        "removed": Boolean,
        "createdAt": 1624414655822,
        "defaultGroupWatch": "string",
        "defaultDirectChatWatch": "string",
        "defaultUserChatWatch": "string",
        "operatorScore": 0,
        "touchScore": 0,
        "avatar": {
          "bucket": "string",
          "key": "string",
          "width": 0,
          "height": 0
        },
        "operatorEmailReminder": Boolean,
        "operator": Boolean,
        "operatorScheduling": Boolean,
        "operatorTimeRanges": {
          "timeRanges": [
            {
              "dayOfWeeks": [
                "mon"
              ],
              "from": 0,
              "to": 0
            }
          ]
        },
        "avatarUrl": "string",
        "managerId": "string"
      },
      "group":{   
         "id": "string",
         "channelId": "string",
         "name": "string",
         "scope": "string",
         "managerIds": [
           "string"
         ],
         "icon": "string",
         "description": "string",
         "createdAt": 1624414651895,
         "updatedAt": 1624414651895,
         "active": Boolean
      }
   }
}

New userchat

Notifies when a new user chat was created. If you registered keywords in Webhook, we will notify you only when a new message contains one of your keywords.

With this event, you can assign one of your manager to the user chat or respond automatically. Refers field contains a user information (User or Veil) and recent message in the user chat.

{
   "event":"push",
   "type":"userChat",
   "entity":{
      "id": "string",
      "channelId": "string",
      "state": "string",
      "managed": Boolean,
      "userId": "string",
      "name": "string",
      "description": "string",
      "handling": {
        "type": "string"
      },
      "source": {
        "page": "string",
        "supportBot": {
          "id": "string",
          "revisionId": "string",
          "sectionPath": [
            "string"
          ]
        },
        "marketing": {
          "type": "string",
          "id": "string"
        }
      },
      "managerIds": [
        "string"
      ],
      "assigneeId": "string",
      "tags": [
        "string"
      ],
      "firstOpenedAt": 1624414657416,
      "openedAt": 1624414657416,
      "createdAt": 1624414657416,
      "frontMessageId": "string",
      "frontUpdatedAt": 1624414657416,
      "deskMessageId": "string",
      "deskUpdatedAt": 1624414657417,
      "firstAssigneeIdAfterOpen": "string",
      "firstRepliedAtAfterOpen": 1624414657416,
      "oneStop": Boolean,
      "waitingTime": 0,
      "avgReplyTime": 0,
      "totalReplyTime": 0,
      "replyCount": 0,
      "resolutionTime": 0,
      "operationWaitingTime": 0,
      "operationAvgReplyTime": 0,
      "operationTotalReplyTime": 0,
      "operationReplyCount": 0,
      "operationResolutionTime": 0,
      "askedAt": 1624414657416,
      "closedAt": 1624414657416,
      "snoozedAt": 1624414657422,
      "expiresAt": 1624414657422,
      "version": 0
   },
   "refers":{
      "message":{
         "chatKey": "string",
         "id": "string",
         "mainKey": "string",
         "threadKey": "string",
         "root": Boolean,
         "channelId": "string",
         "chatType": "string",
         "chatId": "string",
         "personType": "string",
         "personId": "string",
         "requestId": "string",
         "language": "string",
         "createdAt": 1624414655810,
         "version": 0,
         "blocks": [
           {
             "type": "text",
             "value": "string"
           }
         ],
         "plainText": "string",
         "updatedAt": 1624414655811,
         "buttons": [
           {
             "title": "string",
             "colorVariant": "string",
             "url": "string"
           }
         ],
         "reactions": [
           {
             "emojiName": "string",
             "personKeys": [
               "string"
             ]
           }
         ],
         "state": "string",
         "marketing": {
           "type": "string",
           "id": "string",
           "advertising": Boolean,
           "exposureType": "string"
         },
         "supportBot": {
           "id": "string",
           "revisionId": "string",
           "sectionId": "string",
           "stepIndex": 0,
           "buttons": [
             {
               "text": "string",
               "nextSectionId": "string"
             }
           ],
           "submitButtonIndex": 0
         },
         "threadMsg": Boolean,
         "broadcastedMsg": Boolean,
         "rootMessageId": "string"
      },
      "user":{
         "id": "string",
         "channelId": "string",
         "memberId": "string",
         "veilId": "string",
         "unifiedId": "string",
         "type": "strint",
         "name": "string",
         "mobileNumberQualified": Boolean,
         "emailQualified": Boolean,
         "profile": {
           "CUSTOM_KEY": "CUSTUM_VALUE",
           ...
         },
         "tags": [
           "string"
         ],
         "alert": 0,
         "unread": 0,
         "blocked": Boolean,
         "unsubscribed": Boolean,
         "hasChat": Boolean,
         "hasPushToken": Boolean,
         "language": "string",
         "country": "string",
         "city": "string",
         "latitude": 0,
         "longitude": 0,
         "web": {
           "device": "string",
           "os": "string",
           "osName": "string",
           "browser": "string",
           "browserName": "string",
           "sessionsCount": 0,
           "lastSeenAt": 1624414657951
         },
         "mobile": {
           "device": "string",
           "os": "string",
           "osName": "string",
           "appName": "string",
           "appVersion": "string",
           "sessionsCount": 0,
           "lastSeenAt": 1624414657951
         },
         "sessionsCount": 0,
         "lastSeenAt": 1624414655762,
         "createdAt": 1624414655787,
         "updatedAt": 1624414655762,
         "version": 0,
         "managedKey": 0,
         "member": Boolean,
         "email": "string",
         "avatarUrl": "string",
         "mobileNumber": "string",
         "systemLanguage": "string"
      }
   }
}
{
   "event":"push",
   "type":"userChat",
   "entity":{
      "id": "string",
      "channelId": "string",
      "state": "string",
      "managed": Boolean,
      "userId": "string",
      "name": "string",
      "description": "string",
      "handling": "string",
      "supportBot": {
        "id": "string",
        "revisionId": "string",
        "sectionPath": [
          "string"
        ]
      },
      "marketing": {
        "type": "string",
        "id": "string",
        "enableSupportBot": Boolean,
        "supportBotId": "string"
      },
      "pluginId": "string",
      "sourcePage": "string",
      "messengerType": "string",
      "messengerId": "string",
      "managerIds": [
        "string"
      ],
      "assigneeId": "string",
      "tags": [
        "string"
      ],
      "firstOpenedAt": 1624414657416,
      "openedAt": 1624414657416,
      "createdAt": 1624414657416,
      "frontMessageId": "string",
      "frontUpdatedAt": 1624414657416,
      "deskMessageId": "string",
      "deskUpdatedAt": 1624414657417,
      "firstAssigneeIdAfterOpen": "string",
      "firstRepliedAtAfterOpen": 1624414657416,
      "oneStop": Boolean,
      "waitingTime": 0,
      "avgReplyTime": 0,
      "totalReplyTime": 0,
      "replyCount": 0,
      "resolutionTime": 0,
      "operationWaitingTime": 0,
      "operationAvgReplyTime": 0,
      "operationTotalReplyTime": 0,
      "operationReplyCount": 0,
      "operationResolutionTime": 0,
      "askedAt": 1624414657416,
      "closedAt": 1624414657416,
      "snoozedAt": 1624414657422,
      "expiresAt": 1624414657422,
      "version": 0
   },
   "refers":{
      "message":{
         "chatKey": "string",
         "id": "string",
         "mainKey": "string",
         "threadKey": "string",
         "root": Boolean,
         "channelId": "string",
         "chatType": "string",
         "chatId": "string",
         "personType": "string",
         "personId": "string",
         "requestId": "string",
         "language": "string",
         "createdAt": 1624414655810,
         "version": 0,
         "blocks": [
           {
             "type": "text",
             "value": "string"
           }
         ],
         "plainText": "string",
         "updatedAt": 1624414655811,
         "buttons": [
           {
             "title": "string",
             "colorVariant": "string",
             "url": "string"
           }
         ],
         "reactions": [
           {
             "emojiName": "string",
             "personKeys": [
               "string"
             ]
           }
         ],
         "state": "string",
         "marketing": {
           "type": "string",
           "id": "string",
           "advertising": Boolean,
           "exposureType": "string"
         },
         "supportBot": {
           "id": "string",
           "revisionId": "string",
           "sectionId": "string",
           "stepIndex": 0,
           "buttons": [
             {
               "text": "string",
               "nextSectionId": "string"
             }
           ],
           "submitButtonIndex": 0
         },
         "threadMsg": Boolean,
         "broadcastedMsg": Boolean,
         "rootMessageId": "string"
      },
      "user":{
         "id": "string",
         "channelId": "string",
         "memberId": "string",
         "veilId": "string",
         "unifiedId": "string",
         "name": "string",
         "tags": [
           "string"
         ],
         "alert": 0,
         "unread": 0,
         "blocked": Boolean,
         "unsubscribed": Boolean,
         "hasChat": Boolean,
         "hasPushToken": Boolean,
         "language": "string",
         "country": "string",
         "city": "string",
         "latitude": 0,
         "longitude": 0,
         "web": {
           "device": "string",
           "os": "string",
           "osName": "string",
           "browser": "string",
           "browserName": "string",
           "sessionsCount": 0,
           "lastSeenAt": 1624414657951
         },
         "mobile": {
           "device": "string",
           "os": "string",
           "osName": "string",
           "appName": "string",
           "appVersion": "string",
           "sessionsCount": 0,
           "lastSeenAt": 1624414657951
         },
         "sessionsCount": 0,
         "lastSeenAt": 1624414655762,
         "createdAt": 1624414655787,
         "updatedAt": 1624414655762,
         "version": 0,
         "managedKey": 0,
         "member": Boolean,
         "email": "string",
         "avatarUrl": "string",
         "mobileNumber": "string",
         "systemLanguage": "string"
      }
   }
}

Upsert User

Notify changes on updating user's contacts(email & mobile number) or push notification ad settings.

{
   "event":"upsert",
   "type":"user",
   "entity":{
      "id": "string",
    	"channelId": "string",
    	"memberId": "string",
    	"veilId": "string",
    	"unifiedId": "string",
    	"type": "member",
      "name": "string",
      "mobileNumberQualified": true,
      "emailQualified": true,
      "profile": {
        "name": "string",
        "empty": true,
        "email": "string",
        "avatarUrl": "string",
        "mobileNumber": "string",
        "additionalProp1": {},
        "additionalProp2": {},
        "additionalProp3": {}
      },
      "profileOnce": {
        "name": "string",
        "empty": true,
        "email": "string",
        "avatarUrl": "string",
        "mobileNumber": "string",
        "additionalProp1": {},
        "additionalProp2": {},
        "additionalProp3": {}
      },
      "tags": [
        "string"
      ],
      "alert": 0,
      "unread": 0,
      "popUpChatId": "string",
      "blocked": true,
      "unsubscribeEmail": true,
      "unsubscribeTexting": true,
      "hasChat": true,
      "hasPushToken": true,
      "language": "string",
      "country": "string",
      "city": "string",
      "latitude": 0,
      "longitude": 0,
      "web": {
        "device": "string",
        "os": "string",
        "osName": "string",
        "browser": "string",
        "browserName": "string",
        "sessionsCount": 0,
        "lastSeenAt": 1656032153127
      },
      "mobile": {
        "device": "string",
        "os": "string",
        "osName": "string",
        "appName": "string",
        "appVersion": "string",
        "sessionsCount": 0,
        "lastSeenAt": 1656032153127
      },
      "sessionsCount": 0,
      "lastSeenAt": 1656032153129,
      "createdAt": 1656032153129,
      "updatedAt": 1656032153129,
      "version": 0,
      "managedKey": 0,
      "member": true,
      "email": "string",
      "avatarUrl": "string",
      "mobileNumber": "string",
      "systemLanguage": "string"
   }
}