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