WhatsApp APIAPI
WhatsApp: mark messages as read
Mark a message received on WhatsApp as read, so the contact sees the two blue ticks, and show the typing indicator through the XBASE API.
Updated on
Marking as read makes the contact see the two blue ticks on their message. With typing, they also see the typing… indicator while the reply has not arrived.
Mark as read
POST https://api.xbase.app/api/external/v1/whatsapp/messages/{messageId}/readmessageId is the id of the message received from the contact (wamid.…), as it arrives in the whatsapp.message.received event of the workspace webhooks. The read receipt goes out through the number that received the message, and Meta also marks the earlier messages of the conversation as read.
| Field | Type | Required | Rule |
|---|---|---|---|
typing | boolean | no | true shows typing… to the contact until the number's next message, for 25 seconds at most |
curl -X POST https://api.xbase.app/api/external/v1/whatsapp/messages/wamid.HBgNNTUyMTk5OTk5MDAwMBUCABIYFDNBMjc1QjE3RjdCNEE1QzlEMjA4AA==/read \
-H "Authorization: Bearer $XBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "typing": true }'Response 200:
{ "success": true }The body is optional: without it, the message is only marked as read.
When to use it
- When your system or agent reads the message, before replying.
- With
typing: true, when the reply takes a few seconds, like an AI agent's. - Reading does not change the 24-hour window: only the contact's message opens the window.
Errors
| Status | code | When |
|---|---|---|
| 400 | (no code) | Invalid body or messageId in the wrong format |
| 400 | NOT_INCOMING_MESSAGE | The message was sent by the business: only a received message can be marked as read |
| 404 | MESSAGE_NOT_FOUND | The message is not from a WhatsApp conversation in this workspace |
| 422 | NUMBER_DISCONNECTED | The number that received the message is disconnected |
| 422 | SEND_REJECTED | XBASE refused, for example, because the conversation number was disconnected |
| 422 | META_ERROR | Meta refused |
See the full format in Errors.