[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmembers\u002Frelations":3,"docs-tabs-chats\u002Fmembers\u002Frelations":6},{"content":4,"lastmod":5},"## Membership records\n\n`GET \u002Fv1\u002Fchats\u002F:dialogId\u002Fusers\u002Frelations`\n\nReturns the membership records of the named users: which of them are in the chat and with what role — owner, manager or member. Useful for checking the result of [adding members](\u002Fdocs\u002Fchats\u002Fmembers\u002Fadd) or [adding managers](\u002Fdocs\u002Fchats\u002Fmembers\u002Fmanagers-add) without fetching all members.\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| `userIds` (query) | string | yes | From 1 to 50 user IDs separated by commas, for example `5,7`. Each is a positive integer without spaces or leading zeros. A repeated ID is allowed and counts toward the limit of 50 |\n\nOther parameters and repeated ones are 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\u002Fusers\u002Frelations?userIds=5,7,12\" \\\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\u002Fusers\u002Frelations?userIds=5,7,12\" \\\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\u002Fusers\u002Frelations?userIds=5,7,12', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconst inChat = new Set(data.relations.map((r) => r.userId))\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fusers\u002Frelations?userIds=5,7,12', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\nconst inChat = new Set(data.relations.map((r) => r.userId))\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.relations` | array | The membership records of the named users who are in the chat. A user outside the chat is not listed |\n| `data.relations[].id` | number | Membership record ID |\n| `data.relations[].userId` | number | User ID |\n| `data.relations[].chatId` | number | Chat ID |\n| `data.relations[].role` | string | The role: `owner`, `manager` or `member` |\n| `data.relations[].isHidden` | boolean | Whether the membership is hidden |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"relations\": [\n      {\n        \"id\": 71,\n        \"userId\": 5,\n        \"chatId\": 42,\n        \"isHidden\": false,\n        \"role\": \"owner\"\n      },\n      {\n        \"id\": 77,\n        \"userId\": 7,\n        \"chatId\": 42,\n        \"isHidden\": false,\n        \"role\": \"member\"\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n400 — no `userIds`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"`userIds` is required: 1-50 Bitrix24 user ids separated by commas (4,7), each a positive integer without spaces or leading zeros.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `userIds` is absent, holds more than 50 IDs or an ID that is not a positive integer, or another parameter or a repeated parameter is passed. 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's 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's 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 access and the `im` scope still apply.\n\n## See also\n\n- [List members](\u002Fdocs\u002Fchats\u002Fmembers\u002Flist)\n- [Add managers](\u002Fdocs\u002Fchats\u002Fmembers\u002Fmanagers-add)\n- [Chat members](\u002Fdocs\u002Fchats\u002Fmembers)\n","2026-10-15",{},1794739544612]