Webhook Management

Configures custom webhooks and toggles system webhook event forwarding for this session. (Paid users only)

GET
https://api.wawp.net/v2/session/webhook?access_token=YOUR_ACCESS_TOKEN&instance_id=Your_Instance_ID&webhooks=%5B%7B%22url%22%3A+%22https%3A%2F%2Fmy-app.com%2Fwebhook%22%2C+%22events%22%3A+%5B%22message%22%2C+%22message.ack%22%2C+%22message.edited%22%5D%2C+%22is_active%22%3A+1%7D%5D

Authentication Required

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

Log In
Test /v2/session/webhook endpoint
GETPOST

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Include the system webhook URL inside the webhooks array during POST requests if you wish to toggle or update its event filters without disabling chat inbox sync.

  • Always ensure your target webhook URL returns a fast HTTP 200/202 status code to prevent engine timeout and automatic retry backoffs.

Webhook Orchestrator: Complete Guide to /v2/session/webhook

The /v2/session/webhook endpoint allows paid developers to directly program and subscribe their instances to real-time events. By calling this endpoint, you can configure your own custom HTTP destination URLs to receive incoming messages, message delivery status (ACKs), groups, calls, polls, presence updates, and more.

[!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.


🏗️ Supported Methods

1. GET - Fetch Current Configurations

Retrieves the list of custom webhooks currently configured on the WhatsApp Engine alongside the Wawp Core system webhook status.

Response Structure:

  • webhooks: An array of user-defined custom webhooks.
  • systemConfig: The core system webhook configurations (for inbox syncing, auto-responders, push notifications, etc.)

2. POST - Configure Webhooks

Allows you to overwrite the current webhooks list or update event filters and toggle statuses.

Request Payload:

  • webhooks: Array of objects containing url (string), events (array of strings), and is_active (boolean or number 0/1).

🚀 Available Events to Subscribe

You can configure each webhook to receive specific event categories to optimize server resources:

  • message: Standard text and media messages (Inbound).
  • message.any: Both incoming and outgoing messages.
  • message.ack: Delivery and read acknowledgements.
  • message.edited: Real-time updates when messages are modified.
  • poll.vote: Real-time updates on poll selections.
  • group.join / group.leave: Group membership changes.
  • call.received: Incoming WhatsApp calls.
  • And many more standard engine events!

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

URL Parameters

Passed in the URL query string
string

The 12-character ID of the instance

Example:
string

Your API Access Token

Example:
array

Array of webhook configurations to set (for POST requests)

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/session/webhook";
3const params = new URLSearchParams({
4 "instance_id": "Your_Instance_ID",
5 "access_token": "YOUR_ACCESS_TOKEN",
6 "webhooks": "[{\"url\": \"https://my-app.com/webhook\", \"events\": [\"message\", \"message.ack\", \"message.edited\"], \"is_active\": 1}]"
7}).toString();
8
9
10fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
11 method: "GET",
12 headers: { "Content-Type": "application/json" },
13
14})
15 .then(async (response) => {
16 if (response.ok) {
17 const data = await response.json();
18 console.log("Success:", data);
19 return data;
20 }
21
22 // Error Handling
23 if (response.status === 400) {
24 console.error("Error 400: Bad Request - Missing Required Parameter(s)");
25 }
26 if (response.status === 400) {
27 console.error("Error 400: Bad Request (XML Format)");
28 }
29 if (response.status === 400) {
30 console.error("Error 400: Bad Request (Plain Text)");
31 }
32 if (response.status === 401) {
33 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
34 }
35 if (response.status === 401) {
36 console.error("Error 401: Unauthorized (XML Format)");
37 }
38 if (response.status === 404) {
39 console.error("Error 404: Not Found - Session Does Not Exist");
40 }
41 if (response.status === 404) {
42 console.error("Error 404: Not Found (XML Format)");
43 }
44 if (response.status === 500) {
45 console.error("Error 500: Internal Server Error - Unexpected Failure");
46 }
47 if (response.status === 500) {
48 console.error("Error 500: Internal Server Error (HTML)");
49 }
50 if (response.status === 502) {
51 console.error("Error 502: Bad Gateway - Connection Failed to Upstream");
52 }
53 if (response.status === 502) {
54 console.error("Error 502: Bad Gateway (XML Format)");
55 }
56
57 const errorText = await response.text();
58 console.error(`Error ${response.status}: ${errorText}`);
59 })
60 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 60, 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 Configuration Synced
Type:
application/json
string *
array *
object *

Example

{
"status": "success",
"webhooks": {
  "0": {
    "url": "https://my-app.com/webhook",
    "events": {
      "0": "message",
      "1": "message.ack"
      },
    "is_active": 1,
    "enabled": true
    }
  },
"systemConfig": {
  "url": "https://app.wawp.net/api/webhook/xxxxxxxxx",
  "is_active": 1,
  "events": {
    "0": "message",
    "1": "message.ack",
    "2": "message.edited"
    }
  }
}
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 TopicAbout WhatsApp Data
Next TopicAbout login authentication

Command Palette

Search for a command to run...