Update Webhook

Modifies an existing webhook URL on an instance: change subscribed events, enable/disable delivery, or update the retry policy. (Paid users only)

PATCH
https://api.wawp.net/v2/webhook/update?access_token=YOUR_ACCESS_TOKEN&events=%5B%22message%22%2C+%22message.ack%22%2C+%22group.v2.update%22%5D&hmac=my-webhook-secret&instance_id=Your_Instance_ID&is_active=0&name=Updated+CRM&retries=%7B%22delay%22%3A+5%2C+%22attempts%22%3A+10%7D&url=https%3A%2F%2Fmy-app.com%2Fwebhook

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/webhook/update endpoint
PATCH
PATCH

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Disable a webhook instead of deleting it when you need to pause it temporarily.

  • After changing events, verify your endpoint still handles the new payload shapes correctly.

  • Keep the system webhook active with at least 'message' events if you use the Wawp inbox.

Update Webhook: /v2/webhook/update

The /v2/webhook/update endpoint lets you modify an existing webhook URL without replacing the whole webhook list. You can change the event filter, toggle the active state, or adjust the retry policy.

[!IMPORTANT] This endpoint is only available for paid subscription accounts (Unlimited tiers). Free tier users will receive a 403 Forbidden error with code subscription_required.


🎯 When to Use This Endpoint

Use this endpoint when you want to:

  • Enable or disable a webhook temporarily without deleting it.
  • Add or remove specific events from a webhook subscription.
  • Change the retry policy (delay and attempts) for a specific URL.

📦 Request Body

  • url (required): The exact webhook URL that already exists on the instance.
  • events (optional): A new array of events. If omitted, the current event list is kept.
  • is_active (optional): 1 to enable or 0 to disable. If omitted, the current state is kept.
  • retries (optional): New retry policy object. If omitted, the current policy is kept.
  • hmac (optional): New HMAC secret. If omitted, the current secret is kept.

🚀 Available Events

The same event list used in the Wawp Dashboard is supported:

CategoryEvents
Messagesmessage, message.any, message.ack, message.ack.group, message.waiting, message.revoked, message.edited, message.reaction, poll.vote, poll.vote.failed
Groupsgroup.join, group.leave, group.v2.join, group.v2.leave, group.v2.update, group.v2.participants
Session & Callssession.status, state.change, presence.update, chat.archive, call.received, call.accepted, call.rejected
Labelslabel.upsert, label.deleted, label.chat.added, label.chat.deleted
Advancedevent.response

� Request Samples

cURL

curl -X PATCH "https://api.wawp.net/v2/webhook/update"   -H "Content-Type: application/json"   -d '{
    "access_token": "YOUR_ACCESS_TOKEN",
    "instance_id": "Your_Instance_ID",
    "url": "https://my-app.com/webhook",
    "name": "Updated CRM",
    "events": ["message", "message.ack", "group.v2.update"],
    "is_active": 0
  }'

JavaScript (Fetch)

const res = await fetch('https://api.wawp.net/v2/webhook/update', {
  method: 'PATCH',
  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', 'group.v2.update'],
    is_active: 0
  })
});
const data = await res.json();
console.log(data);

�🛡️ System Webhook

You can update the system webhook (https://app.wawp.net/api/webhook/{token}) to change which events are synced to the Wawp inbox. The URL itself cannot be changed through this endpoint.

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 object
string

The 12-character ID of the instance

Example:
string

Your API Access Token

Example:
string

The exact webhook URL that already exists on the instance

Example:
string

An updated display name for this webhook

Example:
array

Updated list of event names to subscribe to

Example:
number

1 to enable the webhook, 0 to disable

Example:
object

Updated retry policy: delay in seconds and number of attempts

Example:
string

Updated HMAC secret for request 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.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/webhook/update";
3const params = new URLSearchParams({
4 "instance_id": "Your_Instance_ID",
5 "access_token": "YOUR_ACCESS_TOKEN"
6}).toString();
7const body = {
8 "url": "https://my-app.com/webhook",
9 "name": "Updated CRM",
10 "events": [
11 "message",
12 "message.ack",
13 "group.v2.update"
14 ],
15 "is_active": "0",
16 "retries": {
17 "delay": 5,
18 "attempts": 10
19 },
20 "hmac": "my-webhook-secret"
21};
22
23fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
24 method: "PATCH",
25 headers: { "Content-Type": "application/json" },
26 body: JSON.stringify(body)
27})
28 .then(async (response) => {
29 if (response.ok) {
30 const data = await response.json();
31 console.log("Success:", data);
32 return data;
33 }
34
35 // Error Handling
36 if (response.status === 400) {
37 console.error("Error 400: Bad Request - Missing Required Parameter(s)");
38 }
39 if (response.status === 400) {
40 console.error("Error 400: Bad Request (XML Format)");
41 }
42 if (response.status === 400) {
43 console.error("Error 400: Bad Request (Plain Text)");
44 }
45 if (response.status === 401) {
46 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
47 }
48 if (response.status === 401) {
49 console.error("Error 401: Unauthorized (XML Format)");
50 }
51 if (response.status === 404) {
52 console.error("Error 404: Not Found - Session Does Not Exist");
53 }
54 if (response.status === 404) {
55 console.error("Error 404: Not Found (XML Format)");
56 }
57 if (response.status === 500) {
58 console.error("Error 500: Internal Server Error - Unexpected Failure");
59 }
60 if (response.status === 500) {
61 console.error("Error 500: Internal Server Error (HTML)");
62 }
63 if (response.status === 502) {
64 console.error("Error 502: Bad Gateway - Connection Failed to Upstream");
65 }
66 if (response.status === 502) {
67 console.error("Error 502: Bad Gateway (XML Format)");
68 }
69
70 const errorText = await response.text();
71 console.error(`Error ${response.status}: ${errorText}`);
72 })
73 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 73, Col 1javascript

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.

Success - Webhook Updated
Type:
application/json
string *
string *
object *

Example

{
"status": "success",
"message": "Webhook updated successfully.",
"webhook": {
  "url": "https://my-app.com/webhook",
  "events": {
    "0": "message",
    "1": "message.ack",
    "2": "group.v2.update"
    },
  "is_active": 0,
  "enabled": false,
  "retries": {
    "delay": 5,
    "attempts": 10
    }
  }
}
Bad Request - Missing Required Parameter(s)
Unauthorized - Invalid or Missing Access Token
Not Found - Session Does Not Exist
Internal Server Error - Unexpected Failure
Bad Gateway - Connection Failed to Upstream
Previous TopicSet Webhook URL
Next TopicDelete Webhook URL

Command Palette

Search for a command to run...