[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fdiscovery\u002Faccess":3,"docs-tabs-chats\u002Fdiscovery\u002Faccess":6},{"content":4,"lastmod":5},"## Check access to a chat or message\n\n`GET \u002Fv1\u002Fchats\u002Faccess`\n\nChecks whether the current user can open a chat, a message or both.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (query) | string | no | The chat to check: `chatN` for a group chat, a numeric user ID for a personal dialog, `me` — the current user's personal dialog. `chatN` is the `id` field of a row in [recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent); a user ID comes from the [user list](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `messageId` (query) | number | no | The message to check — a positive integer, the `id` field of a message from the [chat history](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) |\n\nAt least one of the two parameters is required: if neither is passed, there is nothing to check and the request is rejected with `400 MISSING_PARAMS`. Other or repeated parameters are rejected with `400 INVALID_PARAMS` before any call to Bitrix24.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Faccess?dialogId=chat42\" \\\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\u002Faccess?dialogId=chat42\" \\\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\u002Faccess?messageId=1002', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\n\u002F\u002F No access is an error, not result: false\nconst canOpen = res.ok && (await res.json()).data.result === true\nconsole.log('Message accessible:', canOpen)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Faccess?messageId=1002', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst canOpen = res.ok && (await res.json()).data.result === true\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | Always `true`: access granted |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"result\": true\n  }\n}\n```\n\n## Error response example\n\n422 — the message does not exist in the Bitrix24 account:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"MESSAGE_NOT_FOUND\",\n    \"b24Code\": \"MESSAGE_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_PARAMS` | Neither `dialogId` nor `messageId` was passed |\n| 400 | `INVALID_PARAMS` | `messageId` is not a positive integer, `dialogId` is empty, a parameter other than `dialogId` and `messageId` is passed, or a parameter is repeated |\n| 403 | `BITRIX_ACCESS_DENIED` | No access to the chat or the message |\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`. `CHAT_NOT_FOUND` — the chat does not exist on the portal, `MESSAGE_NOT_FOUND` — the message does not exist |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user when using the `me` alias |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode, and either the request was not made with an employee's personal key or the `dialogId` passed does not point to an existing dialog |\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 checks are independent.** With both parameters the endpoint checks the chat and the message separately and does not verify that the message belongs to that chat. To find the chat of a message, open the chat [around the message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload-in-context).\n\n**The check may make you a member.** The check follows the same path as opening the chat: when the chat allows auto-join — a comment chat, a collab or a task chat, for example — the call adds the current user as a member. This targeted read operation is available to a `READONLY` key when it is an employee's personal key with the `im` scope. A `dialogId`, if passed, must point to an existing dialog: `chatN` or a user ID from that employee's recent dialogs. It does not mark messages as read by itself.\n\n## See also\n\n- [Chat discovery](\u002Fdocs\u002Fchats\u002Fdiscovery)\n- [Dialog details](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fget)\n- [Load a chat](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload)\n","2026-10-07",{},1794739534054]