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
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 body: body fields and query parameters are rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/sharing-links/Xk9pQ2mZ7rT4vB1c" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
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

javascript
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

javascript
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
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.result Typeboolean Descriptiontrue — the link is revoked

Response example

JSON
{
  "success": true,
  "data": {
    "result": true
  }
}

Error response example

422 — the link is already revoked:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "SHARING_LINK_ALREADY_REVOKED",
    "b24Code": "SHARING_LINK_ALREADY_REVOKED"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe 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
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionYou cannot revoke another member's individual link or a personal guest invitation — Bitrix24 refused with the ACCESS_DENIED code
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 answered with an unspecified "not found" code. The portal code is in error.b24Code if supplied
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 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
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only — see access rights
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 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.

See also