[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmembers\u002Fmember-entities":3,"docs-tabs-chats\u002Fmembers\u002Fmember-entities":6},{"content":4,"lastmod":5},"## Chat members as entities\n\n`GET \u002Fv1\u002Fchats\u002F:dialogId\u002Fmember-entities`\n\nReturns who the chat consists of as \"type — ID\" pairs: users and the departments linked to the chat. Useful for showing the members in a member picker; user cards come from the [member list](\u002Fdocs\u002Fchats\u002Fmembers\u002Flist).\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog identifier: `chatXXX` for a group chat, a user ID for the personal dialog with that user, or the alias `me` for the personal dialog with yourself |\n\nQuery parameters are not accepted: any of them 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\u002Fchat42\u002Fmember-entities\" \\\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\u002Fchat42\u002Fmember-entities\" \\\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\u002Fchat42\u002Fmember-entities', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconst userIds = data.memberEntities.filter(([type]) => type === 'user').map(([, id]) => id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fmember-entities', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\nconst userIds = data.memberEntities.filter(([type]) => type === 'user').map(([, id]) => id)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.memberEntities` | array | `[type, ID]` pairs. `user` — a member with their ID. `department` — a linked department: the ID is a number when its subdepartments are included, and a string `\u003CID>:F` for the department alone. Bots and guests are not listed |\n| `data.userCount` | number | The number of members, bots and guests included |\n| `data.areUsersCollapsed` | boolean | `true` — the chat has 1000 members or more, and the users are not listed in `memberEntities` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"memberEntities\": [\n      [\"user\", 5],\n      [\"user\", 7],\n      [\"department\", 12]\n    ],\n    \"userCount\": 2,\n    \"areUsersCollapsed\": false\n  }\n}\n```\n\n## Error response example\n\n422 — the chat does not exist in the Bitrix24 account:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"CHAT_NOT_FOUND\",\n    \"hint\": \"dialogId must be a userId (number as string) for DMs or \\\"chat{N}\\\" for group chats. Examples: \\\"1\\\" for user 1, \\\"chat123\\\" for group chat 123. Create a group chat first via POST \u002Fv1\u002Fbots\u002F:botId\u002Fchats if needed.\",\n    \"b24Code\": \"CHAT_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A query parameter was sent — the endpoint takes none. 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` | Read-only key, and the chat is not confirmed: a value other than `chatN` was passed and the personal dialog was not found in the same employee's recent dialog list — up to 20 pages and 4000 rows — or the alias creates a dialog. Rejected before any call to Bitrix24 |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | Read-only key that is not an employee personal key: an application key with a user session, a [management key](\u002Fdocs\u002Fmanagement-keys), or a key with an unconfirmed owner |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned \"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 missing chat lands here with the code `CHAT_NOT_FOUND` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | The user could not be resolved for the `me` alias |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Reading may make you a member.** If the chat allows auto-join, Bitrix24 may add the caller as a member. A `READONLY` key may perform this read under two conditions: it is an employee personal key, and the chat is confirmed — `chatN` was passed or the personal dialog was found in the same employee's recent dialogs. The read does not mark messages as read. The user's Bitrix24 permissions and the `im` scope still apply.\n\n## See also\n\n- [List members](\u002Fdocs\u002Fchats\u002Fmembers\u002Flist)\n- [Membership records](\u002Fdocs\u002Fchats\u002Fmembers\u002Frelations)\n- [Chat members](\u002Fdocs\u002Fchats\u002Fmembers)\n","2026-10-15",{},1794739544224]