Summary

If you use multiple WhatsApp numbers in Wati, you can configure webhooks to receive events from one or more numbers through a single webhook setup.

You can also identify which WhatsApp number triggered an event using the channelPhoneNumber and channelId fields in the webhook payload, where supported.

This guide explains how to configure webhooks for multiple WhatsApp numbers, set up webhooks for individual numbers using the API, and identify the number associated with each webhook event.

Instructions

Configure webhooks for multiple WhatsApp numbers

Follow these steps to configure a webhook for multiple WhatsApp numbers:

  • Log in to your Wati account and go to Connectors > Webhooks.

  • Click Add Webhook.

  • Select one or more WhatsApp numbers for which you want to receive webhook events.

  • Select the events you want to track, such as Message Received and Chat Assigned.

  • Click Save to activate the webhook configuration for the selected numbers.

Configure webhooks for individual WhatsApp numbers using the API

You can also configure webhooks for individual WhatsApp numbers using the Wati API.

Use the following API endpoint:

POST /{tenantId}/api/v2/webhookEndpoints
  • Include the phoneNumber parameter in your API request to specify the WhatsApp number for which you want to configure the webhook.

Replace {tenantId} with your Wati tenant ID.

Identify the WhatsApp number that triggered a webhook event

When you receive a webhook event, you can use the following fields in the payload to identify the WhatsApp number associated with it:

  • channelPhoneNumber: Contains the WhatsApp phone number associated with the event, where supported.

  • channelId: Identifies the WhatsApp channel associated with the event. This field returns null for the default WhatsApp number.

When is channelPhoneNumber available?

The channelPhoneNumber field is not included in every webhook event. Its availability depends on the event type and how the webhook is configured.

  • Message and template events: The field is available in these event payloads.

  • WABA-level events: The field is not available.

  • Template Failed event: The field is included only when the webhook is configured for a specific WhatsApp number. If the webhook is configured at the WhatsApp Business Account (WABA) level, the field is not included in the payload.

Limitations

The Payment Captured event is not supported for multiple WhatsApp numbers. It works only with the default WhatsApp number.

Frequently Asked Questions (FAQs)

Webhook configuration

1. Can I configure webhooks for multiple WhatsApp numbers in Wati?

Yes. You can configure webhooks for one or more WhatsApp numbers from Webhook settings in your Wati account. Select the WhatsApp numbers and the event types you want to track.

2. Can I configure webhooks for individual WhatsApp numbers using the Wati API?

Yes. Use the following API endpoint to configure webhooks for individual WhatsApp numbers:

POST /{tenantId}/api/v2/webhookEndpoints

Include the phoneNumber parameter to specify the WhatsApp number for which you want to configure the webhook.

Webhook payload fields

3. How can I identify which WhatsApp number triggered a webhook event?

Use the channelPhoneNumber and channelId fields in the webhook payload, where supported.

  • channelPhoneNumber: Identifies the WhatsApp phone number associated with the event.

  • channelId: Identifies the WhatsApp channel. This field returns null for the default WhatsApp number.

4. Is the channelPhoneNumber field available in all webhook events?

No. The channelPhoneNumber field is available for message and template events but is not included in WABA-level events.

For the Template Failed event, this field is included only when the webhook is configured for a specific WhatsApp number. It is not included when the webhook is configured at the WABA level.

Supported webhook events

5. Does the Payment Captured event support multiple WhatsApp numbers?

No. The Payment Captured event works only with the default WhatsApp number and does not support multiple WhatsApp numbers.

Did this answer your question?