Skip to content

ReadChat Test#

The method is aimed for marking messages in a chat as read. Either all messages or a specified message in a chat can be marked as read.

For the method to work correctly, the Receive webhooks on incoming messages and files setting should be enabled using the SetSettings method or through the console

Messages received after applying the settings receive the read status.
Messages received before applying the settings will remain in the delivered status.


To mark messages in a chat as read, you have to execute a request at:


For apiUrl, idInstance and apiTokenInstance request parameters, refer to Before you start section.

Request parameters#

Parameter Type Mandatory Description
chatId string Yes Chat Id
idMessage string No ID of the incoming message to be marked as read. If not specified, then all unread messages in the chat will be marked as read.

Request body example#

Read mark of a single message in the chat:

    "chatId": "",
    "idMessage": "B275A7AA0D6EF89BB9245169BDF174E6"

Read mark of all messages in the chat:

    "chatId": ""


Response parameters#

Parameter Type Description
setRead boolean Messages read mark flag

Response body example#

    "setRead": true

ReadChatMessage errors#

For a list of errors common to all methods, refer to Common errors section

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}"

payload = "{\r\n\t\"chatId\": \"\",\r\n\t\"idMessage\": \"B275A7AA0D6EF89BB9245169BDF174E6\"\r\n}\r\n"
headers = {
  'Content-Type': 'application/json'

response = requests.request("POST", url, headers=headers, data = payload)

curl --location '{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}
--header 'Content-Type: application/json' \
--data-raw '{
    "chatId": "",
    "idMessage": "B275A7AA0D6EF89BB9245169BDF174E6"
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();

var headers = new HttpHeaders();

var jsonBody = "{\"chatId\": \"\",\"idMessage\": \"BAE5F4886F6F2D05\"}";

var requestEntity = new HttpEntity<>(jsonBody, headers);

var response =, HttpMethod.POST, requestEntity, String.class);
var requestUrl = new StringBuilder();

var response =
    .header("Content-Type", "application/json")
    .body("{\"chatId\": \"\",\"idMessage\": \"BAE5F4886F6F2D05\"}")

Sub ReadChat()
    Dim url As String
    Dim RequestBody As String
    Dim http As Object
    Dim response As String

    ' The apiUrl, idInstance and apiTokenInstance values are available in console, double brackets must be removed
    url = "{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}"

    ' chatId - chat in which messages will be read ( for private chats, for group chats)
    RequestBody = "{""chatId"":""""}"

    Set http = CreateObject("MSXML2.XMLHTTP")

    With http
        .Open "POST", url, False
        .setRequestHeader "Content-Type", "application/json"
        .send RequestBody
    End With

    response = http.responseText

    Debug.Print response

    ' Outputting the answer to the desired cell
    Range("A1").Value = response

    Set http = Nothing
End Sub