Get Chats Overview
Retrieve a summary of all active chats and messages metadata.
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
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:
- Identity (
id,name): The JID and the display name (as seen by the Wawp engine). - Unread Count (
unreadCount): A real-time shard of messages that have not yet been marked as "seen." - 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/readfor that specific chat ID. - The next call to
/chats/overviewwill returnunreadCount: 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 whereunreadCount > 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/listendpoint for exhaustive searching. - Media Previews: The
lastMessage.bodywill 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 stringstring | 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.
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
{
"0": {
"id": "201234567890@c.us",
"name": "John Doe",
"unreadCount": 5,
"lastMessage": {
"id": "ABC123",
"body": "Hello!",
"timestamp": 1722170400
}
}
}Command Palette
Search for a command to run...