Mark as read

Mark unread messages as read for a specific chat.

POST
https://api.wawp.net/v2/chats/read?access_token=YOUR_ACCESS_TOKEN&chatId=201234567890%40c.us&days=1&instance_id=123456789&messages=10

Authentication Required

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

Log In
Test /v2/chats/read endpoint
POST
POST

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Store the read state in your own CRM database to avoid redundant API calls.

  • Use the 'days' parameter to bulk-clear old unread messages for inactive customers.

  • Use this endpoint to restore visibility to conversations that were accidentally opened.

The Art of the Blue Tick: Mastering Read States

In WhatsApp, the transition from grey ticks (delivered) to blue ticks (read) is a high-stakes psychological event. The /v2/chats/read endpoint allows your application to programmatically trigger this state change. Whether you are building an automated helpdesk or a synchronized multi-agent CRM, managing "Read Receipts" correctly is critical for maintaining user trust and professional responsiveness.


🏗️ Technical Workflow of a Read Event

When you mark a chat as read via Wawp, the engine performs a specialized "Acknowledgment Handshake":

  1. Selection: Based on your messages or days parameters, the engine identifies the unread message cluster in the specified chatId.
  2. Network Broadcast: A "Seen" packet is transmitted via the WhatsApp WebSocket.
  3. UI Synchronization: This event ripples across all other devices linked to the account (WhatsApp Web, Mobile, Desktop), instantly clearing the unread badges and turning the sender's ticks blue.

🚀 Strategic Implementation Patterns

1. The "Human-Agent" Sync

If you are building a custom dashboard for agents:

  • Trigger: Detact when an agent clicks on a chat thread to open it.
  • Action: Immediately call /v2/chats/read for that JID. This signals to the customer that "Someone is looking at your message," which drastically improves the perceived quality of service.

2. The "Bot-First" Approach

If an AI bot handles the initial triage:

  • Best Practice: Mark the messages as read as soon as the bot processes them. This keeps the agent's "Unread" list clean, ensuring they only focus on chats where the bot needs human escalation.
  • Tip: Use the messages: 1 parameter if you only want to acknowledge the most recent interaction.

🛡️ Best Practices for UX Management

  • Avoid "Ghost Reading": High-scale automation should be careful not to mark every incoming message as read instantly. This creates a "Responsiveness Gap"—the user sees the blue ticks and expects a reply in seconds. If your bot isn't ready to reply, consider delaying the "read" action until the processing is complete.
  • Batching reads: Use the days parameter for "Inbox Cleanup" routines. For example, mark all messages from the last 7 days as read for any chat you are about to archive.
  • JID Accuracy: Ensure you use the full JID (@c.us or @g.us). Marking a group as read will clear the sharded unread count for every participant's message within that group.

🧩 Advanced Use Case: Session Completion Logic

When an agent resolves a support ticket:

  1. Call /v2/chats/read to ensure everything is marked as seen.
  2. Send a "Thank you" closing message.
  3. Archive the chat. This three-step flow represents the gold standard of professional WhatsApp chat management.

⚠️ Important Considerations

  • Privacy Settings: If the sender of the message has turned off "Read Receipts" in their WhatsApp settings, your blue ticks will not show for them, but your unread counts inside Wawp will still be cleared.
  • Engine State: This endpoint requires the session to be in the WORKING state. If the engine is starting or stopped, the "Read" packet cannot be transmitted to the WhatsApp network.
  • Irreversibility: Once a message is marked as read, it cannot be "un-read" (turning the ticks back to grey) on the sender's device. While Wawp has a /v2/chats/unread endpoint, that only affects the local badge on your side, not the sender's blue ticks.

Summary of Capabilities:

  • Programmatic triggering of WhatsApp blue ticks (Read Receipts).
  • Global synchronization across all linked devices (Web/Mobile/Desktop).
  • Granular control via message count or time-based (days) selection.
  • Critical for building professional agent Dashboards and CRM integrations.

Request Parameters

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

Request Body

Sent as a JSON object
string

WhatsApp Instance ID

Example:
string

API Access Token

Example:
string

Recipient's WhatsApp ID (JID). Supports Individuals (@c.us), Groups (@g.us), and Newsletters (@newsletter).

Example:
number

How many latest to read

Example:
number

How many latest days to read

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/read";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "YOUR_ACCESS_TOKEN"
6}).toString();
7const body = {
8 "chatId": "201234567890@c.us",
9 "messages": "10",
10 "days": "1"
11};
12
13fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },
16 body: JSON.stringify(body)
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 TopicGet messages in chat
Next TopicGet message by id

Command Palette

Search for a command to run...