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 |
|---|---|---|---|---|
dialogId (path) |
string | yes | — | Dialog 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
curl -X POST "https://vibecode.bitrix24.com/v1/chats/chat2000/comments/read-all" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
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
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
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 |
|---|---|---|
success |
boolean | Always true on success |
data.result |
boolean | true — the channel comments were marked as read |
Response example
{
"success": true,
"data": { "result": true }
}
Error response example
422 — the chat is not a channel:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "WRONG_MESSAGE_TYPE",
"b24Code": "WRONG_MESSAGE_TYPE"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS |
The body is not a JSON object, or a query parameter or body field was passed. Checked before any call to Bitrix24 |
| 404 | ENTITY_NOT_FOUND |
Bitrix24 returned a generic "not found" code or an error with the text "not found". The portal code is in error.b24Code |
| 422 | BITRIX_ERROR |
Bitrix24 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 |
| 403 | SCOPE_DENIED |
The API key does not have the im scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is read-only: marking comments as read changes data — see access rights |
| 401 | TOKEN_MISSING |
The API key has no Bitrix24 tokens configured |
| 502 | ME_ALIAS_RESOLUTION_FAILED |
Could 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.