Azeer API
  1. Webhooks
Azeer API
  • API Authentication
  • APIs
    • Agents
      • Create Agent
      • Update Agent
      • Get Agent Details
    • Contacts
      • Create Contact
      • Create Bulk Contacts
    • Messages
      • Send Message
      • Delete Message
      • Delete Bulk Messages
    • Webhooks
      • Webhooks
      • List all webhooks
        GET
      • Get Webhook Details
        GET
      • Create Webhook
        POST
      • Delete Webhook
        DELETE
    • App
      • Create User Session
  1. Webhooks

Webhooks

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_changed

Webhook 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"
}

Media Message#

{
  "business_id": "c327668d-47dc-4b3c",
  "contact_id": 101,
  "contact_name": "James",
  "direction": "in",
  "filename_url": "https://cdn.mottasl.ai/msgs/file_909247610841012.aac", // url of the media file
  "from": "91987654321",
  "id": "wamid.HBAEhggNDg3MTZEODFFMzQzQzA4M0VCODdFNTMyMTI5OEM0NDgA",
  "media_id": "909247610841012",
  "message_id": 12345,
  "parent_message_id": 12344,
  "message_type": "audio",  // video | voice | image | document | sticker
  "mime_type": "audio/aac", // video/mp4 | audio/mp3 | image/jpg | application/pdf
  "platform": "whatsapp",
  "timestamp": "2024-03-08T06:48:51Z",
  "to": "966594220647",
  "type": "message",
  "webhook_event_type": "incoming_msg"
}

Reply to interactive button or list#

{
  "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"
}

Reply to template button#

{
  "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 NameDescription
business_idIdentifier for the business or organization associated with the message.
contact_idIdentifier for the contact who sent or received the message.
contact_nameName of the contact who sent or received the message.
directionIndicates the direction of the message (inbound or outbound).
filename_urlURL pointing to the location of the file attached to the media message.
fromSender's phone number.
idUnique identifier for the message.
media_idIdentifier for the media attached to the message.
message_idIdentifier for the message.
message_typeType of the message (audio, video, voice, image, document, etc.).
mime_typeMIME type of the attached file if any.
platformPlatform on which the message was sent or received (e.g., WhatsApp).
timestampTimestamp indicating when the message was sent or received.
toRecipient's phone number.
typeType of event (e.g., message).
webhook_event_typeType 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"
}

Media Message#

{
  "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",    // video | voice | image | document | sticker
  "mime_type": "audio/mp4;",  // video/mp4 | audio/mp3 | image/jpg | application/pdf etc.
  "platform": "whatsapp",
  "timestamp": "2024-03-08T09:52:52.176300915Z",
  "to": "91987654321",
  "type": "message", 
  "webhook_event_type": "outgoing_msg"
}

Create new contact#

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 NameDescription
actionThe action performed on the contact. .
contact_display_nameDisplay name of the contact.
contact_idUnique identifier for the contact.
contact_nameName of the contact.
statusThe status of the contact (e.g., active, archived).
tagsTags associated with the contact.
timestampTimestamp when the contact status was last updated.
typeType of event (e.g., contact).
webhook_event_typeIndicates the type of webhook event, here specified as new_contact.

Archive 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 NameDescription
actionThe action performed on the contact (e.g., update).
contact_display_nameDisplay name of the contact.
contact_idUnique identifier for the contact.
contact_nameName of the contact.
message_idIdentifier for a specific message related to the contact, if applicable.
statusThe status of the contact (e.g., active, archived).
tagsTags associated with the contact.
timestampTimestamp when the contact status was last updated.
typeType of event (e.g., contact).
webhook_event_typeIndicates 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 NameDescription
broadcast_idUnique identifier for the broadcast event.
broadcast_statusThe status of the broadcast, indicating completion in this case.
broadcast_updated_atTimestamp of when the broadcast status was last updated.
webhook_event_typeIndicates the type of webhook event, here specified as broadcast_complete.
Modified at 2025-05-24 13:28:38
Previous
Delete Bulk Messages
Next
List all webhooks
Built with