For AI agents: markdown of this page — /docs-content-en/chats/sharing/link-get.md documentation index — /llms.txt
Get a link by code
GET /v1/chats/sharing-links/:code
Returns 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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parametercode (path) |
Typestring | Requiredyes | DescriptionThe 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 |
The request takes no query parameters: they are rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c', {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log('Chat:', data.sharingLink.entityId, 'type:', data.sharingLink.type)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data } = await res.json()
console.log('Chat:', data.sharingLink.entityId, 'type:', data.sharingLink.type)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.sharingLink.id |
Typenumber | DescriptionLink ID |
Fielddata.sharingLink.entityType |
Typestring | Descriptionchat — a chat link, guest_chat — a guest link |
Fielddata.sharingLink.entityId |
Typestring | DescriptionChat ID without the chat prefix |
Fielddata.sharingLink.code |
Typestring | DescriptionThe link code |
Fielddata.sharingLink.type |
Typestring | Descriptionprimary — the primary link, individual — an individual link, custom — a personal guest invitation |
Fielddata.sharingLink.dateCreate |
Typestring | DescriptionCreation date, ISO 8601 |
Fielddata.sharingLink.dateExpire |
Typestring | null | DescriptionExpiration date. null — no expiration |
Fielddata.sharingLink.requireApproval |
Typeboolean | DescriptionWhether joining requires approval |
Fielddata.sharingLink.url |
Typestring | DescriptionThe link URL |
Fielddata.sharingLink.name |
Typestring | null | DescriptionGuest links only. For an invitation by email or SMS — the address or number it was sent to; for an individual guest link — null |
Response example
{
"success": true,
"data": {
"sharingLink": {
"id": 1012,
"entityId": "42",
"entityType": "chat",
"code": "Xk9pQ2mZ7rT4vB1c",
"type": "individual",
"dateCreate": "2026-09-24T23:02:28+00:00",
"dateExpire": null,
"requireApproval": false,
"url": "https://portal.bitrix24.com/online/?IM_CODE=Xk9pQ2mZ7rT4vB1c"
}
}
}
Error response example
422 — no link with this code exists:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "SHARING_LINK_NOT_FOUND",
"b24Code": "SHARING_LINK_NOT_FOUND"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptioncode does not look like a link code, or a query parameter was passed. Checked before any call to Bitrix24 |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned an error; the portal code is in error.b24Code. SHARING_LINK_NOT_FOUND — no link with this code exists |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionBitrix24 answered with an unspecified "not found" code; the portal code is in error.b24Code |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the im scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no Bitrix24 tokens configured |
The full list of general API errors — Errors.
Known specifics
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 with it is rejected with SHARING_LINK_REVOKED in error.b24Code.
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.
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.