[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Funread-delete":3,"docs-tabs-chats\u002Fmanagement\u002Funread-delete":6},{"content":4,"lastmod":5},"## Clear the \"unread\" mark\n\n`DELETE \u002Fv1\u002Fchats\u002F:dialogId\u002Funread`\n\nClears the \"unread\" mark from the chat's row in the recent dialog list together with the \"[read later](\u002Fdocs\u002Fchats\u002Fmessages\u002Fmark)\" pointer — they cannot be cleared separately. Messages are not marked as read — use [`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fread`](\u002Fdocs\u002Fchats\u002Fmessages\u002Fread) for that.\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 DELETE \"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 DELETE \"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: 'DELETE',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Unread messages:', data.counter)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat123\u002Funread', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\nconsole.log('Unread messages:', data.counter)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.chatId` | number | Chat ID |\n| `data.lastId` | number | ID of the last read message |\n| `data.counter` | number | Number of unread messages after the call — the mark does not affect it |\n| `data.viewedMessages` | array | IDs of messages marked as read. Empty when the mark is cleared |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"chatId\": 123,\n    \"lastId\": 1002,\n    \"counter\": 0,\n    \"viewedMessages\": []\n  }\n}\n```\n\n## Error response example\n\n422 — the chat is not in the recent dialog list:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"READ_RECENT_ITEM_NOT_FOUND_ERROR\",\n    \"b24Code\": \"READ_RECENT_ITEM_NOT_FOUND_ERROR\"\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| 403 | `BITRIX_ACCESS_DENIED` | The chat does not exist or the user has no access to it |\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 outside the recent dialog list — `READ_RECENT_ITEM_NOT_FOUND_ERROR` |\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- **A hidden chat returns to the recent dialog list when a new message arrives in it.** Until then, the call for that chat is rejected.\n\n## See also\n\n- [Set the \"unread\" mark](\u002Fdocs\u002Fchats\u002Fmanagement\u002Funread-create)\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",{},1795415431332]