Chats list & overview
Get a list of all active chats (individuals and groups) with pagination support.
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
Consult the official documentation for detailed parameter descriptions.
Test endpoints in a sandbox environment before production.
Keep your API client library up to date.
Chat List & Management
Retrieve an overview of all conversations currently available in your WhatsApp instance.
🛡️ Best Practices
Mastering the Inbox: High-Scale Chat Retrieval and Synchronization
The /v2/chats endpoint is the administrative gateway to your WhatsApp instance's history. Unlike the overview endpoint, which provides a snapshot, the Chats List API is designed for exhausive discovery and deep synchronization. Whether you are migrating data to a new CRM or building a searchable archive, mastering the nuances of this endpoint is essential for professional WhatsApp integrations.
🏗️ The Mechanics of Chat Discovery
When you request the chat list, the Wawp engine interfaces with its internal encrypted database to reconstruct the conversation graph. This process involves:
- Hydration: Associating the raw JIDs (e.g.,
201234567890@c.us) with their display names and latest status. - State Categorization: Identifying which chats are "Pinned," "Archived," or "Muted."
- Pagination Processing: Calculating the offset and limit logic to deliver a deterministic subset of results.
🚀 Advanced Pagination and Indexing Strategies
In high-volume accounts (5,000+ chats), requesting the "full list" is an anti-pattern that leads to memory spikes and network latency. Follow these professional guidelines:
1. The "Sliding Window" Sync
If you are synchronizing your local database with Wawp for the first time:
- Phase 1: Fetch the first 50 results (
limit=50, offset=0) to get the most recent activity. - Phase 2: Use a recursive loop to fetch subsequent pages (
offset=50, 100, ...) until the response array is empty. - Interrupt Resilience: Store the last successful
offsetin your local database so you can resume the sync if the connection drops.
2. Strategic Sorting
sortBy=id: Useful for alphabetical indexing or consistency checks.sortOrder=DESC: The default and most recommended setting. It ensures that the newest threads — those most likely to require immediate attention — are returned first.
🛡️ Best Practices for Efficient Polling
While Webhooks are the preferred way to receive new messages, the /v2/chats endpoint remains the source of truth for chat state changes (like a user changing their group name or archiving a thread).
- The Delta Sync: Instead of polling the whole list, poll only the first page (
limit=20) every hour. If you detect a change in achatIdthat your system didn't know about, trigger a deep dive for that specific conversation. - Archiving Policy: To keep this list manageable, implement an auto-archiving script. Use the chat list to identify "Zombie" chats (no messages for 90 days) and call the archive endpoint to move them out of the "Active" list.
🧩 Advanced Use Cases
Building a "WhatsApp Explorer"
Create a custom search interface for your team.
- Logic: Fetch the entire chat list (paginated) and index the
nameandidfields in an ElasticSearch or Meilisearch instance. This allows your support agents to find any customer instantly without waiting for the engine to respond.
Bot "Self-Audit"
In a multi-bot environment, use this endpoint to ensure that your bot hasn't been "orphaned" in groups it shouldn't be in. Regularly scan the list for unknown group IDs (@g.us) and programmatically leave them.
⚠️ Important Considerations
- Engine Restarts: During an engine "Cold Boot," the chat list may take a few seconds to populate as it re-syncs with the phone's encrypted storage. Handle
202 Acceptedoremptyresponses gracefully during the first 30 seconds of a session. - Group Permissions: For groups, this endpoint returns the group metadata available to your instance. If you were removed from a group, it may still appear in the list for a short "grace period" before disappearing.
- Memory Management: Each chat object in the response occupies a small amount of memory. In very large requests (e.g.,
limit=500), ensure your application layer (Node.js/Python) has sufficient heap space to parse the JSON payload.
Summary of Capabilities:
- Exhaustive retrieval of all chat threads (Individuals and Groups).
- Deterministic pagination for large-scale data migrations.
- Support for custom sorting to prioritize active conversations.
- Reliable metadata retrieval for CRM and Database indexing.
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: | ||
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.
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
{
"success": true,
"message": "Operation completed successfully"
}Command Palette
Search for a command to run...