[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fsharing\u002Fguest-link":3,"docs-tabs-chats\u002Fsharing\u002Fguest-link":6},{"content":4,"lastmod":5},"## 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","2026-10-01",{},1794739553412]