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

Mark all channel comments as read

POST /v1/chats/:dialogId/comments/read-all

Marks all comments on all posts in the channel as read for you.

Parameters

Parameter Type Required Default Description
ParameterdialogId (path) Typestring Requiredyes Default— DescriptionDialog ID of the channel, chatXXX — the dialogId field of a recent dialogs row. The me alias addresses your personal dialog, not a channel, and results in 422 WRONG_MESSAGE_TYPE

No body is needed. Query parameters and body fields are rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

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

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/chats/chat2000/comments/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/chat2000/comments/read-all', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
console.log('Comments read:', data.result)

JavaScript — OAuth application

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

const { data } = await res.json()
console.log('Comments read:', data.result)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.result Typeboolean Descriptiontrue — the channel comments were marked as read

Response example

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

Error response example

422 — the chat is not a channel:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "WRONG_MESSAGE_TYPE",
    "b24Code": "WRONG_MESSAGE_TYPE"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe body is not a JSON object, or a query parameter or body field was passed. Checked before any call to Bitrix24
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 returned a generic "not found" code or an error with the text "not found". The portal code is in error.b24Code
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error, the portal code is in error.b24Code. CHAT_NOT_FOUND — there is no chat with this dialogId, WRONG_MESSAGE_TYPE — the chat is not a channel
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only: marking comments as read changes data — see access rights
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP502 CodeME_ALIAS_RESOLUTION_FAILED DescriptionCould not resolve the current user for dialogId = me

The full list of common API errors — Errors.

Known specifics

A repeated call is not an error. The response is true even when the channel has no unread comments.

See also