Chats list & overview

Get a list of all active chats (individuals and groups) with pagination support.

GET
https://api.wawp.net/v2/chats?instance_id=123456789&access_token=YOUR_ACCESS_TOKEN&sortBy=id&sortOrder=DESC&limit=20&offset=0

Authentication Required

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

Log In
Test /v2/chats endpoint
GETPOST

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Consult the official documentation for detailed parameter descriptions.

  • Test endpoints in a sandbox environment before production.

  • Keep your API client library up to date.

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

Your unique WhatsApp Instance ID

Example:
string

Your API Access Token

Example:
string

Field to sort by (e.g., id)

Example:
string

Sort direction (ASC or DESC)

Example:
number

Number of chats to return

Example:
number

Number of chats to skip

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

Example

{
"success": true,
"message": "Operation completed successfully"
}
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 TopicChat Management
Next TopicGet Chats Overview

Command Palette

Search for a command to run...