Get Chats Overview

Retrieve a summary of all active chats and messages metadata.

GET
https://api.wawp.net/v2/chats/overview?access_token=123456789&instance_id=123456789

Authentication Required

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

Log In
Test /v2/chats/overview endpoint
GET
GET

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Store the overview in a local cache (like Redux or a Map) for instant UI transitions.

  • Sort the results client-side by timestamp to ensure the most recent conversations are always at the top.

  • Use the unreadCount to drive 'Notification Badges' in your system's navigation.

The Pulse of the Inbox: Mastering Chat Overviews

The /v2/chats/overview endpoint is the most efficient way to build a high-performance messaging dashboard. Instead of fetching the full history of every chat, this endpoint provides a "snapshot" of your entire inbox, allowing you to display active conversations, unread sharded counts, and the most recent message fragments in a single, lightweight API call.

For developers building CRMs, helpdesk software, or monitoring tools, this endpoint is the primary source of truth for the user's "Inbox View."


🏗️ Architecture of an Overview

The response is an array of objects, each representing a single conversation. Each object includes critical metadata:

  1. Identity (id, name): The JID and the display name (as seen by the Wawp engine).
  2. Unread Count (unreadCount): A real-time shard of messages that have not yet been marked as "seen."
  3. Last Message Fragment (lastMessage): A preview of the latest interaction, including its content, timestamp, and unique ID.

🚀 Performance Optimization Strategies

When your Wawp instance manages thousands of chats, fetching the overview can become a heavy operation. Follow these strategies to maintain sub-second response times:

1. Client-Side Virtualization

Do not attempt to render all chats at once if the user has hundreds of active threads.

  • Implementation: Fetch the overview, store it in a local state (Redux/Vuex), and use a "Virtual List" component to render only the visible rows.
  • Update Logic: Instead of re-fetching the entire overview every time a message arrives, use the Webhooks (message.any) to update only the specific row in your local cache.

2. Handling Large Pagination

While /chats/overview is built for speed, very large inboxes (10,000+ chats) should be managed proactively.

  • The "Warm Cache" Approach: Periodically fetch the overview in the background (e.g., every 5 minutes) and store it in your own Redis cache. Your UI should then query your Redis store for instant loading.

🛡️ Best Practices for Inbox Management

1. The "Read Sync" Loop

The unreadCount returned by this endpoint is dynamically updated. To clear a red badge in your UI:

  • Call /v2/chat/read for that specific chat ID.
  • The next call to /chats/overview will return unreadCount: 0.

2. Differentiating Groups vs. Individuals

Use the JID suffix to format your UI:

  • @c.us: Individual chat. Use a user avatar.
  • @g.us: Group chat. Use a group icon and potentially prefix the last message with the sender's name for clarity.

🧩 Advanced Use Cases

Priority Inboxing

Build a "Priority" tab by filtering the overview array on your backend.

  • Logic: Sort by lastMessage.timestamp (descending) and highlight any row where unreadCount > 0.
  • SLA Tracking: If a last message timestamp is older than 2 hours and still "Unread," trigger an internal escalation to a human agent.

⚠️ Important Considerations

  • JID Consistency: Always use the full JID (e.g., 201234567890@c.us) when cross-referencing this data with other endpoints.
  • Archived Chats: By default, the overview includes active chats. To see archived threads, you may need to use specific filter flags (if available in your version) or use the full /v2/chats/list endpoint for exhaustive searching.
  • Media Previews: The lastMessage.body will show a truncated text version of media messages (e.g., "📷 Photo" or "📄 Document"). Your UI should handle these strings gracefully by adding corresponding icons.

Summary of Capabilities:

  • Lightweight snapshot of the entire WhatsApp inbox.
  • Real-time unread count synchronization.
  • Last message previews for context-aware dashboards.
  • Optimal for building "Inbox View" sidebars in CRMs.

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:

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

Overview retrieved successfully.
Type:
Scenario:
application/json
object *

Example

{
"0": {
  "id": "201234567890@c.us",
  "name": "John Doe",
  "unreadCount": 5,
  "lastMessage": {
    "id": "ABC123",
    "body": "Hello!",
    "timestamp": 1722170400
    }
  }
}
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 TopicChats list & overview
Next TopicGet chat picture

Command Palette

Search for a command to run...