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

Set the "unread" mark

POST /v1/chats/:dialogId/unread

Sets the "unread" mark on the chat's row in the recent dialog list — the mark the messenger shows after the "Mark as unread" command. The mark is independent of the unread message counter: it neither marks messages as read nor makes them unread.

Parameters

Parameter Type Required Default Description
ParameterdialogId (path) Typestring Requiredyes Default— DescriptionDialog ID: chatXXX for a group chat, a user ID for a direct dialog, or the me alias. Dialog list — Recent dialogs

There are no query parameters and no body fields. 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/chat123/unread" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

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

const { success } = await res.json()

JavaScript — OAuth application

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

const { success } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.result Typeboolean DescriptionAlways true, see "Known specifics"

Response example

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

Error response example

400 — a body field was sent:

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

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA query parameter or a body field was sent, or the body is not a JSON object. Checked before any call to Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only — the call changes the chat state. Rejected before any call to Bitrix24
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 answered "not found"; the portal code is in error.b24Code
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error; the portal code is in error.b24Code. A chat that does not exist — CHAT_NOT_FOUND
HTTP502 CodeME_ALIAS_RESOLUTION_FAILED DescriptionFailed to resolve the user when using the me alias
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error

Full list of common API errors — Errors.

Known specifics

  • The call does not report whether the mark was set. The response data.result: true arrives regardless of the outcome: when the chat is not in the current user's recent dialog list — for example, the chat was hidden from the list — the mark is not set, but the response is the same. To check the result, read the unread field of the chat's row in the recent dialog list in the v2 mode or isMarkedAsUnread in the counters.
  • A repeated call on a marked chat changes nothing: the "read later" pointer, if set, stays where it was.

See also