[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Funread-create":3,"docs-tabs-chats\u002Fmanagement\u002Funread-create":6},{"content":4,"lastmod":5},"## Set the \"unread\" mark\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Funread`\n\nSets 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.\n\n## Parameters\n\n| Parameter | Type | Required | Default | Description |\n|----------|-----|:-----:|-----------|---------|\n| `dialogId` (path) | string | yes | — | Dialog ID: `chatXXX` for a group chat, a user ID for a direct dialog, or the `me` alias. Dialog list — [Recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\nThere are no query parameters and no body fields. Any query parameter or body field is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat123\u002Funread\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat123\u002Funread\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat123\u002Funread', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { success } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat123\u002Funread', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | Always `true`, see \"Known specifics\" |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"result\": true\n  }\n}\n```\n\n## Error response example\n\n400 — a body field was sent:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Body field `unread` is not accepted by POST \u002Fv1\u002Fchats\u002F:dialogId\u002Funread. It takes no body fields.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A query parameter or a body field was sent, or the body is not a JSON object. Checked before any call to Bitrix24 |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — the call changes the chat state. Rejected before any call to Bitrix24 |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered \"not found\"; the portal code is in `error.b24Code` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. A chat that does not exist — `CHAT_NOT_FOUND` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user when using the `me` alias |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **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](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) in the v2 mode or `isMarkedAsUnread` in the [counters](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fcounters).\n- **A repeated call on a marked chat changes nothing:** the \"[read later](\u002Fdocs\u002Fchats\u002Fmessages\u002Fmark)\" pointer, if set, stays where it was.\n\n## See also\n\n- [Clear the \"unread\" mark](\u002Fdocs\u002Fchats\u002Fmanagement\u002Funread-delete)\n- [Read later](\u002Fdocs\u002Fchats\u002Fmessages\u002Fmark)\n- [Mark as read](\u002Fdocs\u002Fchats\u002Fmessages\u002Fread)\n- [Unread counters](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fcounters)\n- [Chat management](\u002Fdocs\u002Fchats\u002Fmanagement)\n","2026-10-05",{},1795415431169]