[{"data":1,"prerenderedAt":18},["ShallowReactive",2],{"docs-chats\u002Fsharing":3,"docs-tabs-chats\u002Fsharing":6},{"content":4,"lastmod":5},"# Links and guests\n\nInvite employees of the Bitrix24 account to a chat by link, and people outside the Bitrix24 account — guests — by guest link, email or SMS. Revocation depends on the link type: personal email and SMS invitations cannot be revoked.\n\n**Scope:** `im` | **Base URL:** `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1` | **Authorization:** `X-Api-Key`\n\nBitrix24 API: `im.v2.Chat.SharingLink.*`, `im.v2.SharingLink.get`, `im.v2.Chat.joinByCode`, `im.v2.Guest.Link.*`\n\n## Operations\n\n- [Get the primary chat link](.\u002Fsharing\u002Fprimary-link.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Fprimary`\n- [Get an individual chat link](.\u002Fsharing\u002Findividual-link.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Findividual`\n- [Regenerate an individual link](.\u002Fsharing\u002Findividual-link-regenerate.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Findividual\u002Fregenerate`\n- [Get a link by code](.\u002Fsharing\u002Flink-get.md) — `GET \u002Fv1\u002Fchats\u002Fsharing-links\u002F:code`\n- [Revoke a link by code](.\u002Fsharing\u002Flink-revoke.md) — `DELETE \u002Fv1\u002Fchats\u002Fsharing-links\u002F:code`\n- [Join a chat by code](.\u002Fsharing\u002Fjoin.md) — `POST \u002Fv1\u002Fchats\u002Fjoin-by-code`\n- [Get a guest link](.\u002Fsharing\u002Fguest-link.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-links`\n- [Regenerate a guest link](.\u002Fsharing\u002Fguest-link-regenerate.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-links\u002Fregenerate`\n- [Revoke a guest link](.\u002Fsharing\u002Fguest-link-revoke.md) — `DELETE \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-links`\n- [Invite guests by email](.\u002Fsharing\u002Finvite-email.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-invites\u002Femail`\n- [Invite guests by SMS](.\u002Fsharing\u002Finvite-phone.md) — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-invites\u002Fphone`\n\n## Two kinds of links\n\nEndpoints that issue or read a link return it as a `sharingLink` object; for invitations, the object is nested in the invitation's response item. The kind of link is defined by the `entityType` and `type` fields.\n\n| | Chat link | Guest link |\n|---|---|---|\n| Who joins | An employee of the Bitrix24 account — [by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin) | A person outside the Bitrix24 account — by opening the address from the `url` field in a browser |\n| `entityType` | `chat` | `guest_chat` |\n| `type` | `primary` — the primary link, one per chat. `individual` — an individual link; each member has their own | `individual` — a member's individual guest link. `custom` — a personal invitation by email or SMS |\n| `dateExpire` | `null` — no expiration | One day after creation |\n\n`code` is the link code. A chat link carries it in the `IM_CODE` parameter: the code is used to read the link and to join the chat. Only individual links can be revoked by code; a primary chat link cannot be revoked, and personal email and SMS invitations remain valid until `dateExpire`. Your own guest link can be revoked, but a guest joins through its `url`, not `join-by-code`.\n\n## Typical scenario\n\n1. Get your individual chat link — `POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Findividual` — and pass its `code` to a colleague.\n2. The colleague joins the chat — `POST \u002Fv1\u002Fchats\u002Fjoin-by-code` with this code.\n3. When the link is no longer needed, revoke it — `DELETE \u002Fv1\u002Fchats\u002Fsharing-links\u002F:code`.\n\n## What you need to know\n\n**A link code grants access to the chat.** Anyone who knows the code can join the chat. Share the code and the link address only over a secure channel. The code sits in the path of the `GET` and `DELETE \u002Fv1\u002Fchats\u002Fsharing-links\u002F:code` requests, and the request path is recorded in the logs of proxy servers on the way to the API.\n\n**Every call except reading by code is a write.** Endpoints with `dialogId` in the path create, regenerate or revoke links and may make you a chat member if the chat allows auto-join. A read-only key gets `403 WRITE_BLOCKED_READONLY_KEY` on them before any call to Bitrix24 — even with `generateIfNotExists: false`. A read-only key can read a [link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get). For details, see [access rights](\u002Fdocs\u002Faccess-rights).\n\n**Invitations contain data about people outside the Bitrix24 account.** Vibecode does not store the addresses and phone numbers from the invitation body in its logs. However, every invitation sent leaves a system message with the address or number in the chat, and all members see it.\n\n## See also\n\n- [Chats and messages](\u002Fdocs\u002Fchats)\n- [Members](\u002Fdocs\u002Fchats\u002Fmembers)\n- [Access rights](\u002Fdocs\u002Faccess-rights)\n","2026-10-15",{"sharing\u002Fprimary-link.md":7,"sharing\u002Findividual-link.md":8,"sharing\u002Findividual-link-regenerate.md":9,"sharing\u002Flink-get.md":10,"sharing\u002Flink-revoke.md":11,"sharing\u002Fjoin.md":12,"sharing\u002Fguest-link.md":13,"sharing\u002Fguest-link-regenerate.md":14,"sharing\u002Fguest-link-revoke.md":15,"sharing\u002Finvite-email.md":16,"sharing\u002Finvite-phone.md":17},"## Get the primary chat link\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Fprimary`\n\nReturns the primary chat link and creates it if the link does not exist yet. A chat has one primary link, which cannot be revoked, and only a member with the right to manage the chat's links can obtain it.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\n## Request fields (body)\n\nThe body is optional.\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `generateIfNotExists` | boolean | no | `false` — only return the existing link without creating a new one. Defaults to `true` |\n\nOther body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Fprimary\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"generateIfNotExists\": false}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Fprimary\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"generateIfNotExists\": false}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Fprimary', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ generateIfNotExists: false }),\n})\n\nconst { success, data, error } = await res.json()\nconsole.log(success ? data.sharingLink.code : error.code)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Fprimary', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ generateIfNotExists: false }),\n})\n\nconst { success, data, error } = await res.json()\nconsole.log(success ? data.sharingLink.code : error.code)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.sharingLink.id` | number | Link ID |\n| `data.sharingLink.entityType` | string | `chat` — a chat link |\n| `data.sharingLink.entityId` | string | Chat ID without the `chat` prefix |\n| `data.sharingLink.code` | string | The link code — for [joining by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin) and for reading the link |\n| `data.sharingLink.type` | string | `primary` — the primary link |\n| `data.sharingLink.dateCreate` | string | Creation date, ISO 8601 |\n| `data.sharingLink.dateExpire` | string \\| null | Expiration date. `null` — no expiration |\n| `data.sharingLink.requireApproval` | boolean | Whether joining requires approval |\n| `data.sharingLink.url` | string | The link URL on the Bitrix24 account; the code is the value of its `IM_CODE` parameter |\n\n## Response example\n\nA link object of the same shape as for an [individual link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link), with `type` equal to `primary`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sharingLink\": {\n      \"id\": 1011,\n      \"entityId\": \"42\",\n      \"entityType\": \"chat\",\n      \"code\": \"Rt5wYn8KqL2vPz3M\",\n      \"type\": \"primary\",\n      \"dateCreate\": \"2026-09-24T23:01:10+00:00\",\n      \"dateExpire\": null,\n      \"requireApproval\": false,\n      \"url\": \"https:\u002F\u002Fportal.bitrix24.com\u002Fonline\u002F?IM_CODE=Rt5wYn8KqL2vPz3M\"\n    }\n  }\n}\n```\n\n## Error response example\n\n403 — a group chat, where the primary link is not issued to any member:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ACCESS_DENIED\",\n    \"message\": \"ACCESS_DENIED\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A body field other than `generateIfNotExists`, a body that is not an object, a `generateIfNotExists` that is neither `true` nor `false`, or a query parameter. Checked before any call to Bitrix24 |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to manage the chat's links — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `SHARING_LINK_NOT_FOUND` — no link exists and `generateIfNotExists: false` was passed. `CHAT_NOT_FOUND` — the chat does not exist on the portal |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for 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 read-only and the call is a write — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A group chat does not issue a primary link.** Bitrix24 grants no member, not even the owner, the right to manage a group chat's links, so the call returns `403 BITRIX_ACCESS_DENIED`. To invite an employee to such a chat by link, give them your [individual link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link).\n\n**The primary link cannot be revoked.** [Revoking by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke) removes only individual links.\n\n**The call is a write even without creating a link.** With `generateIfNotExists: false` no link is created, but a read-only key still gets `403 WRITE_BLOCKED_READONLY_KEY`: the call may make the key owner a chat member if the chat allows auto-join.\n\n## See also\n\n- [Get an individual chat link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link)\n- [Get a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get)\n- [Join a chat by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Get an individual chat link\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Findividual`\n\nReturns your individual chat link and creates it if the link does not exist yet. An employee of the Bitrix24 account joins the chat with the link code, and each member has their own link.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\n## Request fields (body)\n\nThe body is optional.\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `generateIfNotExists` | boolean | no | `false` — only return the existing link without creating a new one. Defaults to `true` |\n\nOther body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Findividual\" \\\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\u002Fsharing-links\u002Findividual\" \\\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\u002Fsharing-links\u002Findividual', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Link code:', data.sharingLink.code)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Findividual', {\n  method: 'POST',\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('Link code:', data.sharingLink.code)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.sharingLink.id` | number | Link ID |\n| `data.sharingLink.entityType` | string | `chat` — a chat link |\n| `data.sharingLink.entityId` | string | Chat ID without the `chat` prefix |\n| `data.sharingLink.code` | string | The link code — for [joining by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin), reading and revoking |\n| `data.sharingLink.type` | string | `individual` — an individual link |\n| `data.sharingLink.dateCreate` | string | Creation date, ISO 8601 |\n| `data.sharingLink.dateExpire` | string \\| null | Expiration date. `null` — no expiration |\n| `data.sharingLink.requireApproval` | boolean | Whether joining requires approval |\n| `data.sharingLink.url` | string | The link URL on the Bitrix24 account; the code is the value of its `IM_CODE` parameter |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sharingLink\": {\n      \"id\": 1012,\n      \"entityId\": \"42\",\n      \"entityType\": \"chat\",\n      \"code\": \"Xk9pQ2mZ7rT4vB1c\",\n      \"type\": \"individual\",\n      \"dateCreate\": \"2026-09-24T23:02:28+00:00\",\n      \"dateExpire\": null,\n      \"requireApproval\": false,\n      \"url\": \"https:\u002F\u002Fportal.bitrix24.com\u002Fonline\u002F?IM_CODE=Xk9pQ2mZ7rT4vB1c\"\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — there is no link, and `generateIfNotExists` is `false`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"SHARING_LINK_NOT_FOUND\",\n    \"b24Code\": \"SHARING_LINK_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A body field other than `generateIfNotExists`, a body that is not an object, a `generateIfNotExists` that is neither `true` nor `false`, or a query parameter. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `SHARING_LINK_NOT_FOUND` — no link exists with `generateIfNotExists: false`. `CHAT_NOT_FOUND` — the chat does not exist on the portal |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to invite to this chat — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only and the call is a write — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A repeated call returns the same link.** While the link is valid, every call returns it with the same `code`. A new code comes from [regeneration](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link-regenerate).\n\n**The call is a write even without creating a link.** With `generateIfNotExists: false`, no link is created, but a read-only key still gets `403 WRITE_BLOCKED_READONLY_KEY`: the call may make the key owner a chat member if the chat allows auto-join.\n\n## See also\n\n- [Regenerate an individual link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link-regenerate)\n- [Revoke a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke)\n- [Join a chat by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Regenerate an individual link\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fsharing-links\u002Findividual\u002Fregenerate`\n\nRevokes your individual chat link and issues a new one with a different code. Use it when the previous code has reached the wrong people: the old code can no longer be used to join the chat.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\nThe request takes no body: body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Findividual\u002Fregenerate\" \\\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\u002Fsharing-links\u002Findividual\u002Fregenerate\" \\\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\u002Fsharing-links\u002Findividual\u002Fregenerate', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('New code:', data.sharingLink.code)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fsharing-links\u002Findividual\u002Fregenerate', {\n  method: 'POST',\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('New code:', data.sharingLink.code)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.sharingLink.id` | number | ID of the new link |\n| `data.sharingLink.entityType` | string | `chat` — a chat link |\n| `data.sharingLink.entityId` | string | Chat ID without the `chat` prefix |\n| `data.sharingLink.code` | string | The new link code |\n| `data.sharingLink.type` | string | `individual` — an individual link |\n| `data.sharingLink.dateCreate` | string | Creation date, ISO 8601 |\n| `data.sharingLink.dateExpire` | string \\| null | Expiration date. `null` — no expiration |\n| `data.sharingLink.requireApproval` | boolean | Whether joining requires approval |\n| `data.sharingLink.url` | string | The link URL on the Bitrix24 account; the code is the value of its `IM_CODE` parameter |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sharingLink\": {\n      \"id\": 1013,\n      \"entityId\": \"42\",\n      \"entityType\": \"chat\",\n      \"code\": \"Cf7uiH1rnL4m6dQe\",\n      \"type\": \"individual\",\n      \"dateCreate\": \"2026-09-24T23:06:27+00:00\",\n      \"dateExpire\": null,\n      \"requireApproval\": false,\n      \"url\": \"https:\u002F\u002Fportal.bitrix24.com\u002Fonline\u002F?IM_CODE=Cf7uiH1rnL4m6dQe\"\n    }\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 body field or a query parameter was passed. Checked before any call to Bitrix24 |\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 |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to invite to this chat — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only and the call is a write — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Automatic chat membership.** The call can make the key owner a member of a chat that allows auto-join, even if the link operation is subsequently refused. A read-only key is blocked before Bitrix24 is called.\n\n**The old link can still be read but is no longer accepted.** [Reading by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get) returns the previous link exactly as before, with no revocation flag in the response. Joining with the old code is rejected with `422` and `SHARING_LINK_REVOKED` in `error.b24Code`.\n\n## See also\n\n- [Get an individual chat link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link)\n- [Revoke a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Get a link by code\n\n`GET \u002Fv1\u002Fchats\u002Fsharing-links\u002F:code`\n\nReturns a link by its code — a chat link or a guest link. Use it to find out, from the code in a link URL, which chat the link leads to and what kind of link it is.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `code` (path) | string | yes | The link code — the `code` field of the link object or the `IM_CODE` parameter of its address. From 1 to 64 printable characters without spaces |\n\nThe request takes no query parameters: they 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\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c\" \\\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\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c\" \\\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\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Chat:', data.sharingLink.entityId, 'type:', data.sharingLink.type)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c', {\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('Chat:', data.sharingLink.entityId, 'type:', data.sharingLink.type)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.sharingLink.id` | number | Link ID |\n| `data.sharingLink.entityType` | string | `chat` — a chat link, `guest_chat` — a guest link |\n| `data.sharingLink.entityId` | string | Chat ID without the `chat` prefix |\n| `data.sharingLink.code` | string | The link code |\n| `data.sharingLink.type` | string | `primary` — the primary link, `individual` — an individual link, `custom` — a personal guest invitation |\n| `data.sharingLink.dateCreate` | string | Creation date, ISO 8601 |\n| `data.sharingLink.dateExpire` | string \\| null | Expiration date. `null` — no expiration |\n| `data.sharingLink.requireApproval` | boolean | Whether joining requires approval |\n| `data.sharingLink.url` | string | The link URL |\n| `data.sharingLink.name` | string \\| null | Guest links only. For an invitation by email or SMS — the address or number it was sent to; for an individual guest link — `null` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sharingLink\": {\n      \"id\": 1012,\n      \"entityId\": \"42\",\n      \"entityType\": \"chat\",\n      \"code\": \"Xk9pQ2mZ7rT4vB1c\",\n      \"type\": \"individual\",\n      \"dateCreate\": \"2026-09-24T23:02:28+00:00\",\n      \"dateExpire\": null,\n      \"requireApproval\": false,\n      \"url\": \"https:\u002F\u002Fportal.bitrix24.com\u002Fonline\u002F?IM_CODE=Xk9pQ2mZ7rT4vB1c\"\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — no link with this code exists:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"SHARING_LINK_NOT_FOUND\",\n    \"b24Code\": \"SHARING_LINK_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `code` does not look like a link code, or a query parameter was passed. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `SHARING_LINK_NOT_FOUND` — no link with this code exists |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\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 general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A revoked link is read the same way as a valid one.** The response has no revocation flag: the only thing that distinguishes a revoked link is that [joining by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin) with it is rejected with `SHARING_LINK_REVOKED` in `error.b24Code`.\n\n**Reading does not require chat membership.** The call does not take a chat and does not make you its member, so it works with a read-only key. Chat permissions are not checked on reading: any user of the Bitrix24 account who knows the code can read the link.\n\n**A guest invitation discloses the address.** For a personal invitation by email or SMS, the `name` field holds the address or number of a person outside the Bitrix24 account — forward the response only to people allowed to see that contact.\n\n## See also\n\n- [Join a chat by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Fjoin)\n- [Revoke a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Revoke a link by code\n\n`DELETE \u002Fv1\u002Fchats\u002Fsharing-links\u002F:code`\n\nRevokes your individual link by its code — a chat link or a guest link. After revocation, the code can no longer be used to join the chat. The chat is resolved from the code, so you do not specify it in the path.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `code` (path) | string | yes | The link code — the `code` field of the link object or the `IM_CODE` parameter of its address. From 1 to 64 printable characters without spaces |\n\nThe request takes no body: body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c\" \\\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\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c', {\n  method: 'DELETE',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Revoked:', data.result)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fsharing-links\u002FXk9pQ2mZ7rT4vB1c', {\n  method: 'DELETE',\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('Revoked:', data.result)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | `true` — the link is revoked |\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 link is already revoked:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"SHARING_LINK_ALREADY_REVOKED\",\n    \"b24Code\": \"SHARING_LINK_ALREADY_REVOKED\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | The request failed validation for one of these reasons. `code` does not match the link code format: 1 to 64 printable characters without spaces. A query parameter or body field was passed — the method accepts none. The request body is not a JSON object |\n| 403 | `BITRIX_ACCESS_DENIED` | You cannot revoke another member's individual link or a personal guest invitation — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code. The portal code is in `error.b24Code` if supplied |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused; the portal code is in `error.b24Code`. `SHARING_LINK_ALREADY_REVOKED`: the link is already revoked. `SHARING_LINK_WRONG_PARAMS`: the link is not an individual link that can be revoked this way, for example a primary chat link. `SHARING_LINK_NOT_FOUND`: no link with this code exists |\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| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A guest link can be revoked without a code.** Your guest link can also be revoked with [guest link revocation](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-revoke) — it needs no code, only `dialogId`.\n\n**A revoked link can still be read.** [Reading by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get) returns it exactly as before, with no revocation flag, and joining with it is rejected with `SHARING_LINK_REVOKED`.\n\n## See also\n\n- [Get a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get)\n- [Regenerate an individual link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link-regenerate)\n- [Revoke a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-revoke)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Join a chat by code\n\n`POST \u002Fv1\u002Fchats\u002Fjoin-by-code`\n\nAdds you to the chat that the link with this code leads to. The code comes from the chat's primary link or from a member's individual link.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `code` | string | yes | The link code — the `code` field of the link object or the `IM_CODE` parameter of its address. From 1 to 64 printable characters without spaces |\n\nOther body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fjoin-by-code\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"code\": \"Xk9pQ2mZ7rT4vB1c\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fjoin-by-code\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"code\": \"Xk9pQ2mZ7rT4vB1c\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fjoin-by-code', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ code: 'Xk9pQ2mZ7rT4vB1c' }),\n})\n\nconst { data } = await res.json()\nconsole.log('Dialog:', data.dialogId)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fjoin-by-code', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ code: 'Xk9pQ2mZ7rT4vB1c' }),\n})\n\nconst { data } = await res.json()\nconsole.log('Dialog:', data.dialogId)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.dialogId` | string | The chat's dialog ID in the `chatXXX` format — for [reading messages](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) and [sending](\u002Fdocs\u002Fchats\u002Fmessages\u002Fsend) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"dialogId\": \"chat42\"\n  }\n}\n```\n\n## Error response example\n\n422 — the link is revoked:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"SHARING_LINK_REVOKED\",\n    \"b24Code\": \"SHARING_LINK_REVOKED\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | No `code`, a `code` that does not look like a link code, a body that is not an object, another body field or a query parameter. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `SHARING_LINK_REVOKED` — the link is revoked, `SHARING_LINK_EXPIRED` — the link expired, `SHARING_LINK_USES_LIMIT_REACHED` — its use limit was reached, `SHARING_LINK_NOT_FOUND` — no link with this code exists |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to join chats — Bitrix24 refused with the `ACCESS_DENIED` code |\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 general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Joining again changes nothing.** If you are already a chat member, the call returns the same `dialogId` and does not change the chat membership.\n\n## See also\n\n- [Get an individual chat link](\u002Fdocs\u002Fchats\u002Fsharing\u002Findividual-link)\n- [Get a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get)\n- [List members](\u002Fdocs\u002Fchats\u002Fmembers\u002Flist)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Get a guest link\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-links`\n\nReturns your guest link to the chat and creates it if the link does not exist yet. A person outside the Bitrix24 account joins the chat through the link URL, and each member has their own guest link.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\nThe request takes no body: body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links\" \\\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\u002Fguest-links\" \\\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\u002Fguest-links', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Guest link:', data.sharingLink.url, 'until', data.sharingLink.dateExpire)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links', {\n  method: 'POST',\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('Guest link:', data.sharingLink.url, 'until', data.sharingLink.dateExpire)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.sharingLink.id` | number | Link ID |\n| `data.sharingLink.entityType` | string | `guest_chat` — a guest link |\n| `data.sharingLink.entityId` | string | Chat ID without the `chat` prefix |\n| `data.sharingLink.code` | string | The link code — for [reading](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get) and [revoking by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke) |\n| `data.sharingLink.type` | string | `individual` — an individual guest link |\n| `data.sharingLink.dateCreate` | string | Creation date, ISO 8601 |\n| `data.sharingLink.dateExpire` | string | Expiration date — one day after creation |\n| `data.sharingLink.requireApproval` | boolean | Whether joining requires approval |\n| `data.sharingLink.url` | string | The URL the guest opens |\n| `data.sharingLink.name` | null | Always `null` for an individual guest link |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sharingLink\": {\n      \"id\": 1014,\n      \"entityId\": \"42\",\n      \"entityType\": \"guest_chat\",\n      \"code\": \"Pq7Rs2Tu9Vw4Xy1Z\",\n      \"type\": \"individual\",\n      \"dateCreate\": \"2026-09-24T23:07:13+00:00\",\n      \"dateExpire\": \"2026-09-25T23:07:13+00:00\",\n      \"requireApproval\": false,\n      \"url\": \"https:\u002F\u002Fb24.to\u002Fgi\u002Fa1b2c3d4e5-Pq7Rs2Tu9Vw4Xy1Z?IM_DIALOG=chat42\",\n      \"name\": null\n    }\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 body field or a query parameter was passed. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `GUEST_FEATURE_DISABLED` — guests are disabled on the portal, `CHAT_NOT_FOUND` — the chat does not exist on the portal |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to manage the chat's guest links — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only and the call is a write — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Automatic chat membership.** The call can make the key owner a member of a chat that allows auto-join, even if the link operation is subsequently refused. A read-only key is blocked before Bitrix24 is called.\n\n**Links count toward the invitation limit.** Every new guest link, including regenerated and revoked ones, counts toward the author's limit of 10 guest links per hour, which is checked by [invitations by email](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-email) and [by SMS](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-phone).\n\n## See also\n\n- [Regenerate a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-regenerate)\n- [Revoke a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-revoke)\n- [Invite guests by email](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-email)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Regenerate a guest link\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-links\u002Fregenerate`\n\nRevokes your guest link to the chat and issues a new one with a different code and URL. Use it when the previous URL has reached the wrong people: the old link can no longer be used to join the chat.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\nThe request takes no body: body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links\u002Fregenerate\" \\\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\u002Fguest-links\u002Fregenerate\" \\\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\u002Fguest-links\u002Fregenerate', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('New guest link:', data.sharingLink.url)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links\u002Fregenerate', {\n  method: 'POST',\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('New guest link:', data.sharingLink.url)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.sharingLink.id` | number | ID of the new link |\n| `data.sharingLink.entityType` | string | `guest_chat` — a guest link |\n| `data.sharingLink.entityId` | string | Chat ID without the `chat` prefix |\n| `data.sharingLink.code` | string | The new link code |\n| `data.sharingLink.type` | string | `individual` — an individual guest link |\n| `data.sharingLink.dateCreate` | string | Creation date, ISO 8601 |\n| `data.sharingLink.dateExpire` | string | Expiration date — one day after creation |\n| `data.sharingLink.requireApproval` | boolean | Whether joining requires approval |\n| `data.sharingLink.url` | string | The URL the guest opens |\n| `data.sharingLink.name` | null | Always `null` for an individual guest link |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sharingLink\": {\n      \"id\": 1015,\n      \"entityId\": \"42\",\n      \"entityType\": \"guest_chat\",\n      \"code\": \"Rq4vbWE6tT97ksNa\",\n      \"type\": \"individual\",\n      \"dateCreate\": \"2026-09-24T23:07:36+00:00\",\n      \"dateExpire\": \"2026-09-25T23:07:36+00:00\",\n      \"requireApproval\": false,\n      \"url\": \"https:\u002F\u002Fb24.to\u002Fgi\u002Fa1b2c3d4e5-Rq4vbWE6tT97ksNa?IM_DIALOG=chat42\",\n      \"name\": null\n    }\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 body field or a query parameter was passed. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `GUEST_FEATURE_DISABLED` — guests are disabled on the portal, `CHAT_NOT_FOUND` — the chat does not exist on the portal |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to manage the chat's guest links — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only and the call is a write — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nThe full list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Automatic chat membership.** The call can make the key owner a member of a chat that allows auto-join, even if the link operation is subsequently refused. A read-only key is blocked before Bitrix24 is called.\n\n**Guests who already joined are removed.** Regeneration revokes the old link and removes from the chat guests who joined through it. Personal email and SMS invitations are not revoked and remain valid until `dateExpire`.\n\n**All members see a system message.** Regeneration leaves a message in the chat saying that the old link no longer gives access to the chat.\n\n**The new link counts toward the invitation limit.** A regenerated link counts toward the author's limit of 10 guest links per hour, which is checked by [invitations by email](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-email) and [by SMS](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-phone).\n\n## See also\n\n- [Get a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link)\n- [Revoke a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-revoke)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Revoke a guest link\n\n`DELETE \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-links`\n\nRevokes your guest link to the chat: its URL can no longer be used to join the chat. The link code is not needed; the dialog ID is enough.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\nThe request takes no body: body fields and query parameters are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links\" \\\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\u002Fguest-links', {\n  method: 'DELETE',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Revoked:', data.result)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-links', {\n  method: 'DELETE',\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('Revoked:', data.result)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | `true` — the link is revoked |\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 — there is no valid guest link:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"SHARING_LINK_NOT_FOUND\",\n    \"b24Code\": \"SHARING_LINK_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A body field or a query parameter was passed. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. `SHARING_LINK_NOT_FOUND` — you have no valid guest link, `GUEST_FEATURE_DISABLED` — guests are disabled on the portal, `CHAT_NOT_FOUND` — the chat does not exist on the portal |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to manage the chat's guest links — Bitrix24 refused with the `ACCESS_DENIED` code |\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 general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Automatic chat membership.** The call can make the key owner a member of a chat that allows auto-join, even if the link operation is subsequently refused. A read-only key is blocked before Bitrix24 is called.\n\n**The revocation is visible in the chat.** After revocation, a system message saying that you revoked the guest link appears in the chat, and all members see it.\n\n**Guests who already joined are removed.** Revocation closes the old URL to new guests and removes from the chat guests who joined through it. Personal email and SMS invitations remain valid until `dateExpire`.\n\n## See also\n\n- [Get a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link)\n- [Regenerate a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-regenerate)\n- [Revoke a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Invite guests by email\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-invites\u002Femail`\n\nSends chat invitations by email to people outside the Bitrix24 account: a personal guest link is created for each address, and Bitrix24 sends it in an email. Up to 10 invitations per call.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `invitations` | array | yes | Invitations, from 1 to 10 items |\n| `invitations[].email` | string | yes | The guest's email address, up to 254 characters |\n| `invitations[].name` | string \\| null | no | The guest's name for the invitation text, up to 255 characters |\n\nOther body and item fields, as well as query parameters, are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Femail\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invitations\": [{\"email\": \"guest@example.invalid\", \"name\": \"Alex\"}]}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Femail\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invitations\": [{\"email\": \"guest@example.invalid\", \"name\": \"Alex\"}]}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Femail', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ invitations: [{ email: 'guest@example.invalid', name: 'Alex' }] }),\n})\n\nconst { data } = await res.json()\nfor (const item of data) {\n  console.log(item.email, item.error ? `not sent: ${item.error.code}` : 'sent')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Femail', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ invitations: [{ email: 'guest@example.invalid', name: 'Alex' }] }),\n})\n\nconst { data } = await res.json()\nfor (const item of data) {\n  console.log(item.email, item.error ? `not sent: ${item.error.code}` : 'sent')\n}\n```\n\n## Response fields\n\n`data` is an array with one item per invitation, in request order. An item is either a sent invitation or a refusal for it.\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` even if some invitations were not sent — check each invitation's outcome in its item |\n| `data[].email` | string | The address from the request |\n| `data[].sharingLink` | object | Sent invitations only. The personal guest link: `entityType` — `guest_chat`, `type` — `custom`, `name` — the email address, `url` — the link URL for the guest, `dateExpire` — one day after creation |\n| `data[].error.code` | string | Refusals only. The refusal code — see \"Per-item refusals\" below |\n| `data[].error.message` | string | Refusals only. The refusal text |\n\n### Per-item refusals\n\n| Code | When |\n|-----|-------|\n| `GUEST_INVITE_INVALID_EMAIL` | The address is invalid |\n| `GUEST_INVITE_COOLDOWN` | This address was already invited to this chat within the last 5 minutes |\n| `GUEST_INVITE_AUTHOR_RATE_LIMIT` | You have created 10 guest links within the last hour — across all chats, including invitations and revoked links |\n| `GUEST_INVITE_EMAIL_SEND_FAILED` | The email was not sent, and the link was deleted |\n\n## Response example\n\nThe first invitation is sent, the second is refused:\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"sharingLink\": {\n        \"id\": 1016,\n        \"entityId\": \"42\",\n        \"entityType\": \"guest_chat\",\n        \"code\": \"Wd3nTf8cLq2yHs6J\",\n        \"type\": \"custom\",\n        \"dateCreate\": \"2026-09-24T23:07:52+00:00\",\n        \"dateExpire\": \"2026-09-25T23:07:52+00:00\",\n        \"requireApproval\": false,\n        \"url\": \"https:\u002F\u002Fb24.to\u002Fgi\u002Fa1b2c3d4e5-Wd3nTf8cLq2yHs6J?IM_DIALOG=chat42&name=Alex\",\n        \"name\": \"guest@example.invalid\"\n      },\n      \"email\": \"guest@example.invalid\"\n    },\n    {\n      \"email\": \"not-an-address@\",\n      \"error\": {\n        \"code\": \"GUEST_INVITE_INVALID_EMAIL\",\n        \"message\": \"GUEST_INVITE_INVALID_EMAIL\"\n      }\n    }\n  ]\n}\n```\n\n## Error response example\n\n400 — an item field is not accepted:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"`invitations[0].phone` is not accepted. Accepted: email, name.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | The body is not an object or carries a field other than `invitations`; `invitations` is missing or does not hold from 1 to 10 items; an item is not an object or carries a field other than `email` and `name`; `email` is empty or longer than 254 characters; `name` is neither a string of up to 255 characters nor `null`; a query parameter was passed. The message names the item index and the field and does not repeat the value. Checked before any call to Bitrix24 |\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 |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to invite guests to this chat — Bitrix24 refused with the `ACCESS_DENIED` code |\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 general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Automatic chat membership.** The call can make the key owner a member of a chat that allows auto-join, even if the link operation is subsequently refused. A read-only key is blocked before Bitrix24 is called.\n\n**A retry after a dropped connection does not send the email twice.** Re-inviting the same address to the same chat within 5 minutes is refused with `GUEST_INVITE_COOLDOWN` instead of sending a second email.\n\n**All chat members will see the address.** Every invitation sent leaves a system message with the guest's address in the chat. Vibecode does not store the invitation body in its logs.\n\n**An invitation cannot be revoked.** Neither [guest link revocation](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-revoke) nor [revoking by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke) removes a personal invitation. The invitation remains valid until its `dateExpire`.\n\n## See also\n\n- [Invite guests by SMS](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-phone)\n- [Get a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link)\n- [Get a link by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-get)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n","## Invite guests by SMS\n\n`POST \u002Fv1\u002Fchats\u002F:dialogId\u002Fguest-invites\u002Fphone`\n\nSends chat invitations by SMS to people outside the Bitrix24 account: a personal guest link is created for each number, and Bitrix24 sends it in a text message. Up to 10 invitations per call.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for a private chat, `me` — your personal dialog. List — [`GET \u002Fv1\u002Fchats\u002Frecent`](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `invitations` | array | yes | Invitations, from 1 to 10 items |\n| `invitations[].phone` | string | yes | The guest's phone number in international format, up to 32 characters |\n| `invitations[].name` | string \\| null | no | The guest's name for the invitation text, up to 255 characters |\n\nOther body and item fields, as well as query parameters, are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Fphone\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invitations\": [{\"phone\": \"+12025550123\", \"name\": \"Alex\"}]}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Fphone\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invitations\": [{\"phone\": \"+12025550123\", \"name\": \"Alex\"}]}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Fphone', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ invitations: [{ phone: '+12025550123', name: 'Alex' }] }),\n})\n\nconst { data } = await res.json()\nfor (const item of data) {\n  console.log(item.phone, item.error ? `not sent: ${item.error.code}` : 'sent')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fguest-invites\u002Fphone', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ invitations: [{ phone: '+12025550123', name: 'Alex' }] }),\n})\n\nconst { data } = await res.json()\nfor (const item of data) {\n  console.log(item.phone, item.error ? `not sent: ${item.error.code}` : 'sent')\n}\n```\n\n## Response fields\n\n`data` is an array with one item per invitation, in request order. An item is either a sent invitation or a refusal for it.\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` even if some invitations were not sent — check each invitation's outcome in its item |\n| `data[].phone` | string | For a sent invitation — the number in the international E.164 format; for a refusal — the number from the request |\n| `data[].sharingLink` | object | Sent invitations only. A personal guest link of the same shape as for an [email invitation](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-email): `entityType` — `guest_chat`, `type` — `custom`, `url` — the link URL for the guest, `name` — the guest's number in E.164 format |\n| `data[].error.code` | string | Refusals only. The refusal code — see \"Per-item refusals\" below |\n| `data[].error.message` | string | Refusals only. The refusal text |\n\n### Per-item refusals\n\n| Code | When |\n|-----|-------|\n| `GUEST_INVITE_INVALID_PHONE` | The number cannot be parsed as a phone number |\n| `GUEST_INVITE_COOLDOWN` | This number was already invited to this chat within the last 5 minutes |\n| `GUEST_INVITE_AUTHOR_RATE_LIMIT` | You have created 10 guest links within the last hour — across all chats, including invitations and revoked links |\n| `GUEST_INVITE_SMS_NOT_CONNECTED` | No SMS provider is connected on the portal |\n| `GUEST_INVITE_SMS_SEND_FAILED` | The SMS was not sent, and the link was deleted |\n\n## Response example\n\nThe invitation was sent:\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"sharingLink\": {\n        \"id\": 5,\n        \"entityId\": \"42\",\n        \"entityType\": \"guest_chat\",\n        \"code\": \"Kp7rVx2mNq9sTb4H\",\n        \"type\": \"custom\",\n        \"dateCreate\": \"2026-10-15T14:28:07+00:00\",\n        \"dateExpire\": \"2026-10-16T14:28:07+00:00\",\n        \"requireApproval\": false,\n        \"url\": \"https:\u002F\u002Fb24.to\u002Fgi\u002Fa1b2c3d4e5-Kp7rVx2mNq9sTb4H?IM_DIALOG=chat42&name=Alex\",\n        \"name\": \"+12025550123\"\n      },\n      \"phone\": \"+12025550123\"\n    }\n  ]\n}\n```\n\n## Error response example\n\n400 — an item field is not accepted:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"`invitations[0].extra` is not accepted. Accepted: phone, name.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | The body is not an object or carries a field other than `invitations`; `invitations` is missing or does not hold from 1 to 10 items; an item is not an object or carries a field other than `phone` and `name`; `phone` is empty or longer than 32 characters; `name` is neither a string of up to 255 characters nor `null`; a query parameter was passed. The message names the item index and the field and does not repeat the value. Checked before any call to Bitrix24 |\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 |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered with an unspecified \"not found\" code; the portal code is in `error.b24Code` |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | Failed to resolve the user for the `me` alias |\n| 403 | `BITRIX_ACCESS_DENIED` | No right to invite guests to this chat, or a chat of this type does not accept guests — for example, a collab. Bitrix24 refused with the `ACCESS_DENIED` code |\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 general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Automatic chat membership.** The call can make the key owner a member of a chat that allows auto-join, even if the link operation is subsequently refused. A read-only key is blocked before Bitrix24 is called.\n\n**A retry after a dropped connection does not send the SMS twice.** Re-inviting the same number to the same chat within 5 minutes is refused with `GUEST_INVITE_COOLDOWN` instead of sending a second message.\n\n**All chat members will see the number.** Every invitation sent leaves a system message with the guest's number in the chat. Vibecode does not store the invitation body in its logs.\n\n**An invitation cannot be revoked.** Neither [guest link revocation](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link-revoke) nor [revoking by code](\u002Fdocs\u002Fchats\u002Fsharing\u002Flink-revoke) removes a personal invitation. The invitation remains valid until its `dateExpire`.\n\n## See also\n\n- [Invite guests by email](\u002Fdocs\u002Fchats\u002Fsharing\u002Finvite-email)\n- [Get a guest link](\u002Fdocs\u002Fchats\u002Fsharing\u002Fguest-link)\n- [Links and guests](\u002Fdocs\u002Fchats\u002Fsharing)\n",1794739553222]