WhatsApp events notify your application about delivery, engagement, and subscription activity.

Supported Events

EventDescription
whatsapp.sentMessage sent
whatsapp.failedDelivery failed
whatsapp.readRecipient read the message
whatsapp.engagedUser interacted with the message
whatsapp.subscribedUser subscribed
whatsapp.unsubscribedUser unsubscribed
whatsapp.message_receivedIncoming WhatsApp message received
The system uses standard spelling whatsapp.message_received for incoming WhatsApp message events.

Reserved Headers

Every WhatsApp webhook request includes the following headers:
HeaderDescription
x-cocoon-event-typeEvent type (e.g., whatsapp.read)
x-cocoon-event-datetimeEvent time
x-cocoon-message-idWhatsApp message ID
x-cocoon-sender-phonenumberSender phone number
x-cocoon-contact-uuidContact UUID
x-cocoon-contact-whatsappContact WhatsApp number

Example Payload

{
    event_type: str
    timestamp: str
    status: str
    sender: str
    receiver: str
    content: Optional[str] = None
    failure_reason: Optional[str] = None
}

Common Use Cases

  • Customer Support Automation: Trigger support tickets or responses when an incoming message is received.
  • CRM Synchronization: Track WhatsApp interactions on customer timeline profiles.
  • Chatbot Workflows: Feed incoming messages directly into custom chatbot engines.
  • Sales Engagement Tracking: Track when users read or engage with template messages.
  • Customer Journey Analytics: Monitor read/delivery rates across WhatsApp campaigns.