For AI agents: markdown of this page — /docs-content-en/chats/sharing/link-revoke.md documentation index — /llms.txt
Revoke a link by code
DELETE /v1/chats/sharing-links/:code
Revokes 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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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 |
The request takes no body: body fields and query parameters are rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "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', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log('Revoked:', data.result)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data } = await res.json()
console.log('Revoked:', data.result)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data.result |
boolean | true — the link is revoked |
Response example
{
"success": true,
"data": {
"result": true
}
}
Error response example
422 — the link is already revoked:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "SHARING_LINK_ALREADY_REVOKED",
"b24Code": "SHARING_LINK_ALREADY_REVOKED"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS |
code does not match the link code format: 1 to 64 printable characters without spaces |
| 400 | INVALID_PARAMS |
A query parameter or body field was passed — the method accepts none |
| 400 | INVALID_PARAMS |
The request body is not a JSON object |
| 403 | BITRIX_ACCESS_DENIED |
You cannot revoke another member's individual link or a personal guest invitation — Bitrix24 refused with the ACCESS_DENIED code |
| 422 | BITRIX_ERROR |
Bitrix24 returned SHARING_LINK_ALREADY_REVOKED — the link is already revoked. The portal code is in error.b24Code |
| 422 | BITRIX_ERROR |
Bitrix24 returned SHARING_LINK_WRONG_PARAMS — the link is not an individual link that can be revoked this way, for example a primary chat link. The portal code is in error.b24Code |
| 422 | BITRIX_ERROR |
Bitrix24 returned SHARING_LINK_NOT_FOUND — no link with this code exists. The portal code is in error.b24Code |
| 404 | ENTITY_NOT_FOUND |
Bitrix24 answered with an unspecified "not found" code. The portal code is in error.b24Code if supplied |
| 403 | SCOPE_DENIED |
The API key does not have the im scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is read-only — see access rights |
| 401 | TOKEN_MISSING |
The API key has no Bitrix24 tokens configured |
| 502 | BITRIX_UNAVAILABLE |
Bitrix24 is unavailable or returned a server error |
The full list of general API errors — Errors.
Known specifics
A guest link can be revoked without a code. Your guest link can also be revoked with guest link revocation — it needs no code, only dialogId.
A revoked link can still be read. Reading by code returns it exactly as before, with no revocation flag, and joining with it is rejected with SHARING_LINK_REVOKED.