[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fdiscovery\u002Fcounters":3,"docs-tabs-chats\u002Fdiscovery\u002Fcounters":6},{"content":4,"lastmod":5},"## Unread counters\n\n`GET \u002Fv1\u002Fchats\u002Fcounters`\n\nReturns the current user's unread message counters across all of their chats in one request. Use it to show unread-count badges in the chat list without reading the messages themselves.\n\n## Parameters\n\nThere are no parameters. Any query parameter is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fcounters\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fcounters\" \\\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\u002Fcounters', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconst unread = data.userCounters.filter((c) => c.counter > 0 && !c.isMuted)\nconsole.log('Chats with unread messages:', unread.length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fcounters', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\nconst unread = data.userCounters.filter((c) => c.counter > 0 && !c.isMuted)\nconsole.log('Chats with unread messages:', unread.length)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.userCounters` | array | Counters for chats that have unread messages or an \"unread\" mark |\n| `data.userCounters[].chatId` | number | Chat ID — to open the chat, use [chat loading](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload) with a `dialogId` of the form `chat\u003CchatId>` |\n| `data.userCounters[].counter` | number | Number of unread messages |\n| `data.userCounters[].parentChatId` | number | ID of the parent chat for comment chats, otherwise `0`. It opens the same way as `chatId` |\n| `data.userCounters[].isMuted` | boolean | Notifications are turned off for the chat |\n| `data.userCounters[].isMarkedAsUnread` | boolean | The chat was manually marked as unread |\n| `data.userCounters[].recentSections` | array | Sections of the chat list the chat is counted in (`default`, `chat`, `tasksTask` and others) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"userCounters\": [\n      {\n        \"chatId\": 1945,\n        \"counter\": 3,\n        \"parentChatId\": 0,\n        \"isMuted\": false,\n        \"isMarkedAsUnread\": false,\n        \"recentSections\": [\"default\"]\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n400 — a query parameter was passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Query parameter `unreadOnly` is not accepted by GET \u002Fv1\u002Fchats\u002Fcounters. It takes no query parameters.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A query parameter was passed — the endpoint takes none |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error. The portal code is in `error.b24Code` |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent)\n- [Load a chat](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload)\n- [Chat discovery](\u002Fdocs\u002Fchats\u002Fdiscovery)\n","2026-10-07",{},1794739534134]