Overview
WhatsApp API Webhooks allow your application to receive real-time updates whenever important WhatsApp events occur. Instead of continuously checking the API for changes, your application automatically receives event notifications at a secure webhook URL.
SPRL allows you to configure individual webhooks for each connected WhatsApp Business account. You can configure a separate webhook endpoint, generate a webhook secret, choose the events you want to receive, and enable or disable notifications independently for each account.
Each WhatsApp account maintains its own webhook configuration and delivery history.
Good to Know:
Webhook configuration is available on supported subscription plans. Your webhook endpoint should be publicly accessible and able to receive HTTPS POST requests.
Open Webhook Settings
- Navigate to Dashboard → WhatsApp → Webhook.
- Open the Webhook Configuration page.
- Select the WhatsApp Business account you want to configure.
- Enter your webhook information.
- Select the events you want to receive.
- Enable webhook notifications.
- Save your configuration.
Important: Each connected WhatsApp account has a separate webhook configuration. Changes made to one account do not affect the webhook settings of another account.
Select a WhatsApp Account
Before configuring a webhook, select the appropriate connected WhatsApp Business account from the account selector.
The selector displays the account's WhatsApp Business Account name and registered phone number.
For example, if you have multiple connected WhatsApp accounts, you can configure:
- Account A: Its own webhook URL and secret key.
- Account B: A different webhook URL and secret key.
- Account C: Its own selected events and notification status.
Each account's webhook settings, delivery attempts and logs are maintained independently.
Webhook Configuration
Configure the following settings for the selected WhatsApp account.
| Setting | Description |
|---|
| Webhook Name | A descriptive name for the webhook configuration. |
| Webhook URL | The HTTPS endpoint that will receive webhook events. |
| Secret Key | Used to verify webhook requests using HMAC SHA256 signatures. |
| Generate | Creates a secure webhook secret automatically. |
| Status | Enables or disables webhook notifications for the selected account. |
| Events | Allows you to select which WhatsApp events should trigger webhook notifications. |
Secret Key: Keep your secret key confidential. Your application needs the same secret key to verify incoming webhook signatures.
Available Webhook Events
Choose the events that your application should receive for the selected WhatsApp account.
| Event | Description |
|---|
| Message Received | Triggered when a customer sends a message. |
| Message Sent | Triggered after a message has been sent. |
| Message Delivered | Triggered when message delivery is confirmed. |
| Message Read | Triggered when a recipient reads a message. |
| Message Failed | Triggered if message delivery fails. |
| Message Replied | Triggered when a customer replies. |
| Conversation Started | Triggered when a new conversation begins. |
| Template Approved | Triggered when a template is approved. |
| Template Rejected | Triggered when a template is rejected. |
| Template Paused | Triggered when a template is paused. |
| Template Disabled | Triggered when a template is disabled. |
Only the events selected in the webhook configuration are eligible for delivery.
Webhook Security
Every webhook request includes security headers that your application can use to verify the authenticity of the request.
| Header | Purpose |
|---|
| Content-Type | Identifies the request format as JSON. |
| User-Agent | Identifies the webhook sender as SPRL. |
| X-Webhook-Event | Specifies the event type being delivered. |
| X-Webhook-Signature | Contains the HMAC SHA256 signature used to verify the request. |
Signature Verification
SPRL generates an HMAC SHA256 signature using the configured Secret Key and the JSON request body.
Your application should:
- Read the raw JSON request body.
- Calculate the HMAC SHA256 signature using the configured Secret Key.
- Compare the calculated signature with the value received in
X-Webhook-Signature. - Process the request only after successful verification.
The signature header follows this format:
sha256=YOUR_GENERATED_SIGNATURE
Always verify the signature before processing webhook events.
Test Your Webhook
Before relying on webhook notifications, you can test the configuration for the selected WhatsApp account.
- Open the Webhook Configuration page.
- Select the WhatsApp account you want to test.
- Ensure the webhook URL is configured and webhook notifications are enabled.
- Click Test Webhook.
- Check the response to confirm whether the endpoint received the test event.
The test generates a webhook.test event and sends it to the configured endpoint.
You can review the test delivery result in the Delivery Logs section.
Webhook Status
The Webhook Status panel provides information about the webhook configuration for the currently selected WhatsApp account.
| Status Item | Description |
|---|
| Last Tested | Most recent webhook test. |
| Last Success | Most recent successful webhook delivery. |
| Last Failure | Most recent failed webhook request. |
| Failure Count | Number of failed webhook deliveries. |
Use this information to monitor the delivery health of each connected WhatsApp account.
Delivery Logs
SPRL maintains delivery logs for webhook requests so you can review the delivery history of each connected WhatsApp account.
Navigate to Dashboard → WhatsApp → API → Delivery Logs.
Select the WhatsApp account to view its corresponding webhook delivery history.
Available Log Information
| Information | Description |
|---|
| Event | Event associated with the webhook request. |
| Destination URL | Webhook endpoint receiving the request. |
| HTTP Code | HTTP response code returned by your endpoint, when available. |
| Status | Indicates whether the delivery succeeded or failed. |
| Response Time | Time taken to receive the endpoint response. |
| Attempts | Number of HTTP delivery attempts made. |
| Date | Date and time of the delivery attempt. |
| Details | Allows you to inspect request and response information. |
Filter Delivery Logs
You can filter delivery logs using the following options:
- Date Range: View delivery attempts within a selected date range.
- Event Type: Filter logs by a specific webhook event.
- Status: Filter successful, failed or pending deliveries.
Click View to inspect the request headers, request payload and response body associated with a delivery attempt.
Important:
Delivery Logs are maintained separately for each WhatsApp account. Selecting a different account displays that account's delivery history.
Webhook Requirements
- Your webhook URL should use HTTPS.
- Your endpoint should accept HTTP POST requests.
- Your endpoint should be publicly accessible.
- Your application should validate webhook signatures using the configured Secret Key.
- Your endpoint should return a successful HTTP 2xx response after processing a request.
- Save your configuration after changing events or settings.
- Ensure the webhook is enabled for the WhatsApp account from which you expect events.
Best Practices
- Generate a strong Secret Key and keep it confidential.
- Configure a separate webhook endpoint where required for different WhatsApp accounts.
- Enable only the webhook events your application requires.
- Always verify webhook signatures before processing requests.
- Process incoming webhook events efficiently.
- Monitor Delivery Logs for failed requests.
- Use HTTPS to protect webhook traffic.
- Test your endpoint after configuring or updating webhook settings.
Troubleshooting
My application isn't receiving webhook events
Verify that you have selected the correct WhatsApp account, webhook notifications are enabled, the required events are selected, and your endpoint is publicly accessible.
Webhook requests are failing
Check whether your endpoint is returning an appropriate HTTP response. Review the HTTP response code, response body and response time in Delivery Logs.
Signature verification is failing
Ensure your application uses the correct Secret Key for the selected WhatsApp account and calculates the HMAC SHA256 signature using the original raw JSON request body.
I am not receiving every event
Confirm that the required event checkboxes are selected and saved for the correct WhatsApp account.
I am seeing logs for another WhatsApp account
Use the account selector on the Delivery Logs page to select the correct WhatsApp Business account. Each account has its own delivery history.
My webhook test is failing
Verify the webhook URL, endpoint accessibility, HTTPS configuration and your endpoint's HTTP response. Check the corresponding webhook.test entry in Delivery Logs for additional information.
Frequently Asked Questions
Can I configure multiple webhooks?
Yes. You can configure one webhook for each connected WhatsApp Business account.
Does each WhatsApp account have a separate Secret Key?
Yes. Each account maintains its own webhook configuration and Secret Key.
Can I choose which events I receive?
Yes. You can select individual message, conversation and template events for each WhatsApp account.
Can I use different webhook URLs for different accounts?
Yes. Each connected WhatsApp account can have its own webhook URL.
How can I test whether my webhook is working?
Use the Test Webhook option on the Webhook Configuration page. You can then review the test result in Delivery Logs.
Where can I find webhook delivery history?
Navigate to Dashboard → WhatsApp → API → Delivery Logs and select the relevant WhatsApp account.
What happens if I disable a webhook?
New webhook events will not be dispatched while the webhook is disabled. You can enable it again from the Webhook Configuration page.
Learn More:
Continue with WhatsApp Pricing & Conversation Charges to understand subscription plans, Meta conversation pricing, and how WhatsApp billing works.
Tip: Configure and test each WhatsApp account independently. Subscribe only to the events your application actually needs to reduce unnecessary processing and simplify integration management.