Receiving Notifications via Webhooks

MessageBird allows you configure webhooks in the Notifications Center for any available product. These will then receive webhooks for notifications subscribed to under that product.

Webhook Request Body

The following is an example of the expected webhook body all notifications will adhere to.

{
"id": "af7f6295-50ff-4c0e-99f1-8976b9d27c5c",
"title": "title example",
"message": "something significant happened for {{you}} on whatsapp",
"category": "WhatsApp",
"subscription_type": "whatsapp-account-update",
"severity": "info",
"calls_to_action": [
{
"type": "GOTO",
"url": "https://relevant-link.com/link1",
"display_text": "Go To"
}
],
"variables": {
"you": {
"type": "LINK",
"url": "https://relevant-link.com/link2",
"display_text": "YOU"
}
},
metadata: {
"extra': "information",
"not': "required"
},
"created_at": "2022-08-12T12:00:00Z"
}

Fields

NameTypeDescriptionOptional
idstringThe unique identifier of the notification.No
titlestringThe optional title message of the notification.Yes
messagestringThe notification body message.No
categorystringThe event/notification product it falls under. See Categories & Subscription Types below.No
subscription_typestringThe event/notification type the notification is related to. See Categories & Subscription Types below.No
severitystringThe severity of the event. success, info, warning, errorNo
calls_to_actionarray[CallToAction]The additional calls to action that are sent with the notification.Yes
variablesmap[string]VariableA mapping of each variable name found in the notification message to its data object.Yes
metadatajsonAny additional data that is supplied for the specific notification. Documentation TBDYes
created_atdatetimeThe time of creation.No

Categories & Subscription types

For each notification, there will be a category with the subscription_type it falls under. Here is a list of all possible categories and their respective subscription_types.

CategorySubscription Types
WhatsAppwhatsapp-channel-update, whatsapp-account-update, whatsapp-phone-number-update, whatsapp-template-update

Call to Action

Calls to action can be included on a notification to provide ways forward based on the notification.

Fields

NameTypeDescriptionOptional
typestringTypes: GOTONo
urlstringURL for a GOTO type call to action.No
display_textstringThe display text for the call to action.No

Variable

A variable will exist on the notification if the notification message contains the same named variable as shown:

{
"message": "This is a message with a {{var1}}.",
"variables": {
"var1": {
"type": "LINK",
"url": "https://valid.com/link",
"display_text": "link"
}
}
}

Fields

NameTypeDescriptionOptional
typestringTypes: LINKNo
urlstringURL for a LINK type variable.No
display_textstringThe display text that would replace the variable. (Used in rendering an html a tag)No

Questions?

We’re always happy to help with code or other doubts you might have! Check out our Quickstarts, API Reference, Tutorials, SDKs, or contact our Support team.

Cookie Settings