[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmessages\u002Fcomments":3,"docs-tabs-chats\u002Fmessages\u002Fcomments":6},{"content":4,"lastmod":5},"## Comment summary for posts\n\n`GET \u002Fv1\u002Fchats\u002Fmessages\u002Fcomments`\n\nReturns a summary of the comment threads of the specified channel posts. A comment thread is a separate chat bound to the post.\n\n## Parameters\n\n| Parameter | Type | Required | Default | Description |\n|----------|-----|:-----:|-----------|---------|\n| `messageIds` (query) | string | yes | — | Comma-separated IDs of posts from one channel, 1 to 100 IDs: `845,846`. Posts of a channel — [Read messages](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) |\n\nAny other parameter, or `messageIds` given more than once, 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\u002Fmessages\u002Fcomments?messageIds=845,846\" \\\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\u002Fmessages\u002Fcomments?messageIds=845,846\" \\\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\u002Fmessages\u002Fcomments?messageIds=845,846', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Posts with comments:', data.commentInfo.map((c) => c.messageId))\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002Fcomments?messageIds=845,846', {\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('Posts with comments:', data.commentInfo.map((c) => c.messageId))\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.commentInfo` | array | One item per post that has a comment thread |\n| `data.commentInfo[].messageId` | number | Post ID |\n| `data.commentInfo[].chatId` | number | ID of the comment chat |\n| `data.commentInfo[].dialogId` | string | Dialog ID of the comment chat, `chatXXX`. Comments of the thread — [Read messages](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) |\n| `data.commentInfo[].messageCount` | number | Number of messages in the thread. A thread opens with a system message, so a thread without comments shows `1` here |\n| `data.commentInfo[].lastUserIds` | array | IDs of the latest commenters. Their details are in `data.usersShort` |\n| `data.commentInfo[].isUserSubscribed` | boolean | `true` — you follow the comments of the post |\n| `data.usersShort` | array | Brief details of the commenters |\n| `data.usersShort[].id` | number | User ID |\n| `data.usersShort[].name` | string | User name |\n| `data.usersShort[].avatar` | string | Avatar URL |\n| `data.usersShort[].color` | string | The user's color in the messenger, `#rrggbb` |\n| `data.usersShort[].type` | string | User type, for example `user` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"usersShort\": [\n      { \"id\": 7, \"name\": \"Anna Smith\", \"avatar\": \"https:\u002F\u002Fcdn.example.com\u002Favatar.jpg\", \"color\": \"#df532d\", \"type\": \"user\" }\n    ],\n    \"commentInfo\": [\n      {\n        \"chatId\": 2001,\n        \"dialogId\": \"chat2001\",\n        \"messageId\": 845,\n        \"lastUserIds\": [7],\n        \"messageCount\": 2,\n        \"isUserSubscribed\": true\n      },\n      {\n        \"chatId\": 2003,\n        \"dialogId\": \"chat2003\",\n        \"messageId\": 846,\n        \"lastUserIds\": [],\n        \"messageCount\": 1,\n        \"isUserSubscribed\": true\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n422 — the posts belong to different channels:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"MESSAGES_IN_DIFFERENT_CHAT_ERROR\",\n    \"b24Code\": \"MESSAGES_IN_DIFFERENT_CHAT_ERROR\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `messageIds` is missing, empty or given more than once, has more than 100 items or an item that is not a positive integer, or another parameter is given. Checked before any call to Bitrix24 |\n| 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` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error, the portal code is in `error.b24Code`. `MESSAGE_NOT_FOUND` — there is no message with this ID, `MESSAGES_IN_DIFFERENT_CHAT_ERROR` — the posts belong to different channels |\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\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The thread appears together with the post.** A thread is created as soon as the post is sent to the channel, before the first comment.\n\n**A post without a thread is skipped without an error.** A forwarded post does not appear in `data.commentInfo`. If all `messageIds` belong to a chat that is not a channel, `data.commentInfo` is empty.\n\n## See also\n\n- [Open the discussion of a post](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcomments-chat)\n- [Mark all channel comments as read](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcomments-read-all)\n- [Follow the comments of a post](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcomments-subscription-create)\n- [Stop following the comments of a post](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcomments-subscription-delete)\n- [Messages around a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcontext)\n","2026-10-30",{},1794739546215]