Skip to content

ReadChat#

Test Postman

The method is intended for marking messages in a chat as read.

For the method to work, you need to enable the Receive notifications about incoming messages and files instance setting through the console or using the SetSettings method

The method uses limits on the request rate per second.

Request#

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

POST
{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}

To get the apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.

Request parameters#

Parameter Type Required Description
chatId string Yes Chat identifier

Request body example#

{
    "chatId": "10000000"
}

Response#

Response fields#

Field Type Description
setRead boolean Flag that the messages are marked as read

Response body example#

Successful execution of the method#

status code 200

{
    "setRead": true
}

Execution of the method with an error#

status code 400

{
    "statusCode": 400,
    "timestamp": "2025-08-21T12:46:15.345Z",
    "path": "/waInstance3100000001/readChat/9ece01c05bbe44768fb674840138bbe6af876fe49b69418fbf",
    "message": "Validation failed. Details: 'chatId' must be a string"
}

ReadChatMessage errors#

For the list of errors common to all methods, see the Common errors section

HTTP code Error identifier Description
400 Bad Request
Validation failed
Validation error

Code examples#

import requests

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

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

response = requests.post(url, json=payload)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}
--header 'Content-Type: application/json' \
--data-raw '{
    "chatId": "10000000",
    "idMessage": "115066794584856130"
}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/readChat/")
    .append({{apiTokenInstance}});

var headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);

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

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

var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.POST, requestEntity, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/readChat/")
    .append({{apiTokenInstance}});

var response = Unirest.post(requestUrl.toString())
    .header("Content-Type", "application/json")
    .body("{\"chatId\": \"10000000\",\"idMessage\": \"115066794584856130\"}")
    .asString();

System.out.println(response);
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 
    RequestBody = "{""chatId"":""10000000""}"

    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