Webhook Events#
This document provides comprehensive details on the structure of webhook events dispatched by our system. The purpose of these webhooks is to facilitate real-time communication, ensuring your application can dynamically respond to various events. Webhook events are categorized based on their nature and each comes with a unique payload structure detailed below. Setting up webhooks via the Azeer Platform is straightforward, enhancing your application's responsiveness to events such as incoming or outgoing messages, new contacts additions, and more.The following sections delve into the specific JSON payload structures associated with different webhook events, including but not limited to, incoming messages (text, audio, document, image), replies to interactive buttons, and broadcast completion notifications. These payloads contain vital information like message type, sender and receiver details, timestamps, and media information, providing your application with the data it needs to process and react to each event effectively.Setup webhook#
To set up a webhook in the Azeer Platform, follow these steps:1.
Navigate to the 'Settings' menu within the Platform.
2.
Select 'Webhooks and APIs' from the options available.
This will allow you to configure and manage webhooks for real-time event notifications.Available webhook events#
incoming_msg
outgoing_msg
chat_assigned
chat_closed
chat_mentioned
template_approved
broadcast_complete
billing_alert
new_contact
for_rules
message_status_changedWebhook notification Examples#
Incoming message to Azeer#
When a message is received from user, the webhook event incoming_msg
is triggered. Here are example of JSON structures for different message types (e.g.,text
audio
, document
, image
):Text Message#
{
"business_id": "c327668d-47dc-4b3c",
"contact_id": 101,
"contact_name": "James",
"direction": "in",
"from": "91987654321",
"id": "wamid.HBAEhggNDYxQUY4ODA3Njg1MTNENUU5OEQyQTQwMzg5REVCNkQA",
"message_id": 12345,
"parent_message_id": 12344,
"message_type": "text",
"platform": "whatsapp",
"text": "hello",
"timestamp": "2024-03-08T06:44:54Z",
"to": "966594220647",
"type": "message",
"webhook_event_type": "incoming_msg"
}
{
"business_id": "c327668d-47dc-4b3c",
"contact_id": 101,
"contact_name": "James",
"direction": "in",
"filename_url": "https://cdn.mottasl.ai/msgs/file_909247610841012.aac",
"from": "91987654321",
"id": "wamid.HBAEhggNDg3MTZEODFFMzQzQzA4M0VCODdFNTMyMTI5OEM0NDgA",
"media_id": "909247610841012",
"message_id": 12345,
"parent_message_id": 12344,
"message_type": "audio",
"mime_type": "audio/aac",
"platform": "whatsapp",
"timestamp": "2024-03-08T06:48:51Z",
"to": "966594220647",
"type": "message",
"webhook_event_type": "incoming_msg"
}
{
"business_id": "c327668d-47dc-4b3c",
"contact_id": 101,
"contact_name": "James",
"direction": "in",
"from": "91987654321",
"id": "wamid.HBAEhggRUVFNjU5MTNGQkFFRENFMUE0OEZDM0VCRTQ3MUU4QTUA",
"interactive_reply_id": "$0",
"message_id": 12345,
"parent_message_id": 12344,
"message_type": "interactive",
"platform": "whatsapp",
"text": "requests",
"timestamp": "2024-03-08T07:30:03Z",
"to": "966594220647",
"type": "message",
"webhook_event_type": "incoming_msg"
}
{
"business_id": "c327668d-47dc-4b3c",
"contact_id": 101,
"contact_name": "James",
"direction": "in",
"from": "91987654321",
"id": "wamid.HBAEhggRTVGRDU0MDQ2N0YzRDY2RkU2MEFFMkI3NDM1OEY4OUYA",
"message_id": 12345,
"parent_message_id": 12344,
"message_type": "text",
"platform": "whatsapp",
"text": "banana",
"timestamp": "2024-03-08T07:32:37Z",
"to": "966594220647",
"type": "message",
"webhook_event_type": "incoming_msg"
}
description of fields in the webhook event payload for incoming message (same can be refered for outgoing message)Field Name | Description |
---|
business_id | Identifier for the business or organization associated with the message. |
contact_id | Identifier for the contact who sent or received the message. |
contact_name | Name of the contact who sent or received the message. |
direction | Indicates the direction of the message (inbound or outbound). |
filename_url | URL pointing to the location of the file attached to the media message. |
from | Sender's phone number. |
id | Unique identifier for the message. |
media_id | Identifier for the media attached to the message. |
message_id | Identifier for the message. |
message_type | Type of the message (audio, video, voice, image, document, etc.). |
mime_type | MIME type of the attached file if any. |
platform | Platform on which the message was sent or received (e.g., WhatsApp). |
timestamp | Timestamp indicating when the message was sent or received. |
to | Recipient's phone number. |
type | Type of event (e.g., message). |
webhook_event_type | Type of webhook event (e.g., incoming message). |
Location message#
The below payload can be referred for avodcado outgoing messages also.{
"business_id": "c327668d-47dc-4b3c-bcb2-d4f459ebb321",
"contact_id": 516,
"contact_name": "James",
"direction": "in",
"from": "919687766345",
"id": "wamid.HBgMOTE5UY2NDY3MzQA",
"latitude": 12.9958923,
"local_timestamp": "0001-01-01T00:00:00Z",
"longitude": 77.6102133,
"message_id": 12345,
"parent_message_id": 12344,
"message_type": "location",
"platform": "whatsapp",
"timestamp": "2024-03-11T12:05:13Z",
"to": "966594220647",
"type": "message",
"webhook_event_type": "incoming_msg"
}
Outgoing message from Azeer#
For messages sent from AVC, the webhook event outgoing_msg
is triggered. Below are examples for different message types:(e.g.,text
audio
, document
, image
):Text Message#
{
"business_id": "c327668d-47dc-4b3c",
"contact_id": 101,
"contact_name": "James",
"direction": "out",
"from": "966594220647",
"id": "wamid.HBAERgSQzRFMTE4RjAwN0I0Q0RDMDk1AA==",
"is_existing_contact": true,
"message_id": 12345,
"parent_message_id": 0,
"message_type": "text",
"platform": "whatsapp",
"text": "hello",
"timestamp": "2024-03-08T09:44:38.116981911Z",
"to": "91987654321",
"type": "message",
"webhook_event_type": "outgoing_msg"
}
{
"business_id": "c327668d-47dc-4b3c",
"contact_id": 101,
"contact_name": "James",
"direction": "out",
"filename": "blob",
"filename_url": "https://cdn.mottasl.ai/media/c327668d-47dc-4b3c/msg/934d4f8c8af84ac7ccbeecc618f0eeed.mp4",
"from": "966594220647",
"id": "wamid.HBAERgSMUZERDQwQkFGQzhCOTZBNzdCAA==",
"is_existing_contact": true,
"media_id": "934d4f8c8af84ac7ccbeecc618f0eeed",
"message_id": 12345,
"parent_message_id": 0,
"message_type": "audio",
"mime_type": "audio/mp4;",
"platform": "whatsapp",
"timestamp": "2024-03-08T09:52:52.176300915Z",
"to": "91987654321",
"type": "message",
"webhook_event_type": "outgoing_msg"
}
When a new contact is added, the webhook event new_contact
is triggered with action insert
{
"action": "insert",
"business_id": "c327668d-47dc-4b3c",
"contact_display_name": "james",
"contact_id": 693,
"contact_name": "james bond",
"platform": "whatsapp",
"platform_id": "919876543211",
"status": "archived",
"tags": "new tag",
"timestamp": "2024-03-08T10:31:00.333982Z",
"type": "contact",
"webhook_event_type": "new_contact"
}
Field Name | Description |
---|
action | The action performed on the contact. . |
contact_display_name | Display name of the contact. |
contact_id | Unique identifier for the contact. |
contact_name | Name of the contact. |
status | The status of the contact (e.g., active, archived). |
tags | Tags associated with the contact. |
timestamp | Timestamp when the contact status was last updated. |
type | Type of event (e.g., contact). |
webhook_event_type | Indicates the type of webhook event, here specified as new_contact . |
When a contact is archived, the webhook event new_contact
is triggered with action update
{
"action": "update",
"contact_display_name": "james",
"contact_id": 693,
"contact_name": "james",
"platform": "whatsapp",
"platform_id": "919876543211",
"status": "archived",
"tags": "new tag",
"timestamp": "2024-03-08T10:31:00.333982Z",
"type": "contact",
"webhook_event_type": "new_contact"
}
Field Name | Description |
---|
action | The action performed on the contact (e.g., update). |
contact_display_name | Display name of the contact. |
contact_id | Unique identifier for the contact. |
contact_name | Name of the contact. |
message_id | Identifier for a specific message related to the contact, if applicable. |
status | The status of the contact (e.g., active, archived). |
tags | Tags associated with the contact. |
timestamp | Timestamp when the contact status was last updated. |
type | Type of event (e.g., contact). |
webhook_event_type | Indicates the type of webhook event, here specified as new_contact . |
Broadcast Complete#
When a broadcast action is completed, the webhook event broadcast_complete
is triggered:{
"broadcast_id": 485,
"broadcast_status": "completed",
"broadcast_updated_at": "2024-03-08T10:55:48.201364799Z",
"business_id": "c327668d-47dc-4b3c",
"timestamp": "0001-01-01T00:00:00Z",
"webhook_event_type": "broadcast_complete"
}
Field Name | Description |
---|
broadcast_id | Unique identifier for the broadcast event. |
broadcast_status | The status of the broadcast, indicating completion in this case. |
broadcast_updated_at | Timestamp of when the broadcast status was last updated. |
webhook_event_type | Indicates the type of webhook event, here specified as broadcast_complete . |
Modified at 2025-05-24 13:28:38