Set Webhook URL
Creates a new webhook URL on an instance or updates an existing one, with a precise list of events to subscribe to. (Paid users only)
Authentication Required
Login to swap the placeholders with your real Instance ID and Access Token.
Log InNo query parameters required
This endpoint doesn't expect data in the URL.
Best practices
Only subscribe to events your application actually needs to reduce bandwidth and processing.
Always respond with HTTP 200 from your webhook endpoint before processing the event asynchronously.
Use a unique secret in the URL query string or hmac field to verify requests come from Wawp.
Set Webhook URL: /v2/webhook/set
The /v2/webhook/set endpoint lets you register a single webhook URL on a WhatsApp instance and choose exactly which events it should receive. If the URL already exists, it is updated in place; otherwise it is appended to the instance's webhook list.
[!IMPORTANT] This endpoint is only available for paid subscription accounts (Unlimited tiers). Free tier users will receive a
403 Forbiddenerror with codesubscription_required.
🎯 When to Use This Endpoint
Use this endpoint when you want to:
- Connect a new backend URL to receive real-time WhatsApp events.
- Replace or refresh an existing webhook without touching other configured webhooks.
- Selectively subscribe to specific event categories to reduce server load.
📦 Request Body
url(required): A publicly reachable HTTPS endpoint that accepts POST requests.events(required): An array of event names the webhook should receive.is_active(optional):1to enable or0to disable the webhook. Defaults to1.retries(optional): Retry policy object withdelay(seconds) andattempts(count). Defaults to{ delay: 2, attempts: 15 }.hmac(optional): A secret string added to theX-Wawp-Signatureheader for basic verification.
🚀 Available Events
These events match the options available in the Wawp Dashboard:
| Category | Events |
|---|---|
| Messages | message, message.any, message.ack, message.ack.group, message.waiting, message.revoked, message.edited, message.reaction, poll.vote, poll.vote.failed |
| Groups | group.join, group.leave, group.v2.join, group.v2.leave, group.v2.update, group.v2.participants |
| Session & Calls | session.status, state.change, presence.update, chat.archive, call.received, call.accepted, call.rejected |
| Labels | label.upsert, label.deleted, label.chat.added, label.chat.deleted |
| Advanced | event.response |
� Request Samples
cURL
curl -X POST "https://api.wawp.net/v2/webhook/set" -H "Content-Type: application/json" -d '{
"access_token": "YOUR_ACCESS_TOKEN",
"instance_id": "Your_Instance_ID",
"url": "https://my-app.com/webhook",
"name": "Production CRM",
"events": ["message", "message.ack", "message.edited"],
"is_active": 1,
"retries": { "delay": 2, "attempts": 15 }
}'
JavaScript (Fetch)
const res = await fetch('https://api.wawp.net/v2/webhook/set', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
access_token: 'YOUR_ACCESS_TOKEN',
instance_id: 'Your_Instance_ID',
url: 'https://my-app.com/webhook',
events: ['message', 'message.ack', 'message.edited'],
is_active: 1,
retries: { delay: 2, attempts: 15 }
})
});
const data = await res.json();
console.log(data);
�� System Webhook Note
If the url you provide matches the instance's system webhook (https://app.wawp.net/api/webhook/{token}), the event filter is also synced to the Wawp database so the dashboard and inbox reflect the same configuration.
Request Parameters
Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.
Request Body
Sent as a JSON objectstring | The 12-character ID of the instance Example: | ||
string | Your API Access Token Example: | ||
string | The HTTPS endpoint that will receive webhook events Example: | ||
array | List of event names to subscribe to Example: | ||
string | — | An optional display name for this webhook (e.g., 'Production CRM', 'Staging Bot') Example: | |
number | — | 1 to enable the webhook, 0 to disable. Default is 1. Example: | |
object | — | Retry policy: delay in seconds and number of attempts Example: | |
string | — | Optional secret used for HMAC signature verification Example: |
Request Samples
Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.
Expected Responses
Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.
Example
{
"status": "success",
"message": "Webhook set successfully.",
"webhook": {
"url": "https://my-app.com/webhook",
"events": {
"0": "message",
"1": "message.ack",
"2": "message.edited"
},
"is_active": 1,
"enabled": true,
"retries": {
"delay": 2,
"attempts": 15
}
}
}Command Palette
Search for a command to run...