Skip to content


The method archives a chat. One can archive chats that have at least one incoming message.


To archive a chat, you have to execute a request at:


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

Request parameters#

Parameter Type Mandatory Description
chatId string Yes User or group chat Id

Request body example#

    "chatId": ""


Response parameters#

The response body is empty. If successful, the server response is 200.

ArchiveChat errors#

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

HTTP code Error identifier Description
400 "ArchiveChatError: cannot archive chat cause last message not found in chat" chatID is false or there is no message in the chat

Python request example#

import requests

url = "{{idInstance}}/archiveChat/{{apiTokenInstance}}"

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

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