This webhook field is gradually being rolled out along with user preferences for marketing messages, and may not be available to you initially.

User preferences webhoooks

WhatsApp users can use the Offers and announcements setting to stop or resume marketing template messages from individual businesses. See the following documents to learn more about this setting:

Trigger events

  • A WhatsApp user stops marketing messages.
  • A WhatsApp user resumes marketing messages.

Cloud API Syntax

{
  "object": "whatsapp_business_account",
  "entry": [{
      "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>",
      "changes": [{
          "value": {
             "messaging_product": "whatsapp",
             "metadata": {
               "display_phone_number": "<BUSINESS_PHONE_NUMBER>",
               "phone_number_id": "<BUSINESS_PHONE_NUMBER_ID>"
             },
             "contacts": [
              {
                "profile": {
                  "name": "<WHATSAPP_USER_NAME>"
                },
                "wa_id": "<WHATSAPP_USER_ID>"
              }
             ],
             "user_preferences": [{
                  "wa_id": "<WHATSAPP_USER_PHONE_NUMBER>",
                  "detail": "<PREFERENCE_DESCRIPTION>",
                  "category" : "marketing_messages",
                  "value" : "<PREFERENCE>"
                  "timestamp": <WEBHOOK_SENT_TIMESTAMP>,
                }]
          },
          "field": "user_preferences"
        }]
    }]
}

Cloud API Parameters

Placeholder Description Example value

<BUSINESS_PHONE_NUMBER_ID>

Business phone number ID.

106540352242922

<BUSINESS_PHONE_NUMBER>

Business display phone number.

+15550783881

<PREFERENCE_DESCRIPTION>

Description of marketing message preference. Values can be:

  • User requested to stop marketing messages
  • User requested to resume marketing messages

User requested to stop marketing messages

<PREFERENCE>

Marketing message preference. Values can be:

  • stop
  • resume

stop

<WEBHOOK_SENT_TIMESTAMP>

Unix timestamp indicating when the webhook was sent.

1731705721

<WHATSAPP_BUSINESS_ACCOUNT_ID>

WhatsApp Business Account ID.

102290129340398

<WHATSAPP_USER_ID>

WhatsApp user's ID.

16505551234

<WHATSAPP_USER_NAME>

WhatsApp user's name.

Pablo Morales

<WHATSAPP_USER_PHONE_NUMBER>

WhatsApp user phone number.

+16505551234

On-Premises API Syntax

{
  "contacts": [
    {
      "profile": {
        "name": "<WHATSAPP_USER_NAME>"
      },
      "wa_id": "<WHATSAPP_USER_ID>"
    }
  ],
  "messages": [
    {
      "from": "<WHATSAPP_USER_PHONE_NUMBER>",
      "id": "<WHATSAPP_MESSAGE_ID>",
      "system": {
        "body": "<PREFERENCE_DESCRIPTION>",
        "marketing": "<PREFERENCE>",
        "type": "user_preference_changed"
      },
      "timestamp": <WEBHOOK_SENT_TIMESTAMP>,
      "type": "system"
    }
  ]
}

On-Premises API Parameters

Placeholder Description Example value

<PREFERENCE_DESCRIPTION>

Description of marketing message preference. Values can be:

  • <WHATSAPP_USER_PHONE_NUMBER> chose to stop receiving marketing messages on WhatsApp from your business
  • <WHATSAPP_USER_PHONE_NUMBER> chose to resume receiving marketing messages on WhatsApp from your business

User requested to stop marketing messages

<PREFERENCE>

Marketing message preference. Values can be:

  • stop
  • resume

stop

<WEBHOOK_SENT_TIMESTAMP>

Unix timestamp indicating when the webhook was sent.

1731705721

<WHATSAPP_MESSAGE_ID>

WhatsApp message ID.

16505551234

<WHATSAPP_USER_ID>

WhatsApp user's ID.

16505551234

<WHATSAPP_USER_NAME>

WhatsApp user's name.

Pablo Morales

<WHATSAPP_USER_PHONE_NUMBER>

WhatsApp user phone number.

+16505551234