For AI agents: markdown of this page — /docs-content-en/chats/management/read-all.md documentation index — /llms.txt

Read all chats

POST /v1/chats/read-all

Marks every message in every chat of the current user as read and resets the user's unread counters. Use it for a "Read all" button in the dialog list.

Important: the call cannot be undone. The "unread" marks and counters of all the user's chats are reset at once, and there is no way to restore them. To read part of the list, use Read a list section; for one dialog, use Mark as read.

Parameters

There are no parameters. No request body is sent. Any query parameter or body field is rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/chats/read-all \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/chats/read-all \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/read-all', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success, data } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/read-all', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.result Typeboolean Descriptiontrue — all of the user's chats are read

Response example

JSON
{
  "success": true,
  "data": {
    "result": true
  }
}

Error response example

400 — a request body was passed:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Body field `all` is not accepted by POST /v1/chats/read-all. It takes no body fields."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA query parameter or a body field was passed. Checked before the Bitrix24 call
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error; the Bitrix24 code is in error.b24Code
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionRead-only key: marking as read counts as a write, see access rights
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error

Full list of common API errors — Errors.

Known specifics

Marking as read is personal. Only the counters of the user the call is made on behalf of are reset. With a personal key, that is the key owner; with an application key and a vibe_session_* session, it is the employee who opened the application.

See also