[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Fjoin":3,"docs-tabs-chats\u002Fmanagement\u002Fjoin":6},{"content":4,"lastmod":5},"## Join a chat\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fjoin`\n\nThe current user joins a chat that can be entered without an invitation. This works for an open chat or channel, an Open Channel, the general chat of the Bitrix24 account, a comment chat, an external chat or an open collab. A system message about the join appears in the chat.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Chat ID as `chatN`, for example `chat42`. To find a chat ID, use [search chats by text](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fsearch) |\n\nThe endpoint accepts no query string parameters and no request body: any parameter or body field is rejected with `400 INVALID_PARAMS` before any call to Bitrix24.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fjoin \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fjoin \\\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\u002Fjoin', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Joined:', data.result) \u002F\u002F true\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fjoin', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | `true` — the user is in the chat |\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 — a chat of this type cannot be joined on your own:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"WRONG_MESSAGE_TYPE\",\n    \"b24Code\": \"WRONG_MESSAGE_TYPE\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A query string parameter or a body field was sent — the endpoint accepts neither |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned \"not found\". The Bitrix24 code is in `error.b24Code` |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused with `WRONG_MESSAGE_TYPE` in `error.b24Code` — a chat of this type cannot be joined on your own |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused with `CHAT_NOT_FOUND` in `error.b24Code` — the chat does not exist in the Bitrix24 account |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user when using the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused with the `ACCESS_DENIED` code: the user is not allowed to join chats or has no access to this chat |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](\u002Fdocs\u002Faccess-rights) |\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**A closed group chat is by invitation only.** In a regular group chat without the open flag, a member with the right to invite adds new members — [adding members](\u002Fdocs\u002Fchats\u002Fmembers\u002Fadd). The `searchable: \"Y\"` field makes a chat open when it is [created in the v2 mode](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fcreate).\n\n**Joining again.** If you are already a member of a chat that can be entered without an invitation, the response is the same — `data.result: true`. The type check comes before the membership check: in a closed chat, even a member of that chat gets `WRONG_MESSAGE_TYPE`.\n\n## See also\n\n- [Chat management](\u002Fdocs\u002Fchats\u002Fmanagement)\n- [Leave a chat](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fleave)\n- [Add members](\u002Fdocs\u002Fchats\u002Fmembers\u002Fadd)\n","2026-10-07",{},1794739540708]