For AI agents: markdown of this page — /docs-content-en/chats/sharing/guest-link-regenerate.md documentation index — /llms.txt

Regenerate a guest link

POST /v1/chats/:dialogId/guest-links/regenerate

Revokes your guest link to the chat and issues a new one with a different code and URL. Use it when the previous URL has reached the wrong people: the old link can no longer be used to join the chat.

Parameters

Parameter Type Required Description
ParameterdialogId (path) Typestring Requiredyes DescriptionDialog ID: chatXXX for a group chat, a numeric user ID for a private chat, me — your personal dialog. List — GET /v1/chats/recent

The request takes no body: body fields and query parameters are rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/chats/chat42/guest-links/regenerate" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/chats/chat42/guest-links/regenerate" \
  -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/chat42/guest-links/regenerate', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
console.log('New guest link:', data.sharingLink.url)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat42/guest-links/regenerate', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
console.log('New guest link:', data.sharingLink.url)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.sharingLink.id Typenumber DescriptionID of the new link
Fielddata.sharingLink.entityType Typestring Descriptionguest_chat — a guest link
Fielddata.sharingLink.entityId Typestring DescriptionChat ID without the chat prefix
Fielddata.sharingLink.code Typestring DescriptionThe new link code
Fielddata.sharingLink.type Typestring Descriptionindividual — an individual guest link
Fielddata.sharingLink.dateCreate Typestring DescriptionCreation date, ISO 8601
Fielddata.sharingLink.dateExpire Typestring DescriptionExpiration date — one day after creation
Fielddata.sharingLink.requireApproval Typeboolean DescriptionWhether joining requires approval
Fielddata.sharingLink.url Typestring DescriptionThe URL the guest opens
Fielddata.sharingLink.name Typenull DescriptionAlways null for an individual guest link

Response example

JSON
{
  "success": true,
  "data": {
    "sharingLink": {
      "id": 1015,
      "entityId": "42",
      "entityType": "guest_chat",
      "code": "Rq4vbWE6tT97ksNa",
      "type": "individual",
      "dateCreate": "2026-09-24T23:07:36+00:00",
      "dateExpire": "2026-09-25T23:07:36+00:00",
      "requireApproval": false,
      "url": "https://b24.to/gi/a1b2c3d4e5-Rq4vbWE6tT97ksNa?IM_DIALOG=chat42",
      "name": null
    }
  }
}

Error response example

422 — the chat does not exist in the Bitrix24 account:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "CHAT_NOT_FOUND",
    "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 /v1/bots/:botId/chats if needed.",
    "b24Code": "CHAT_NOT_FOUND"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA body field 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. GUEST_FEATURE_DISABLED — guests are disabled on the portal, CHAT_NOT_FOUND — the chat does not exist on the portal
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 answered with an unspecified "not found" code; the portal code is in error.b24Code
HTTP502 CodeME_ALIAS_RESOLUTION_FAILED DescriptionFailed to resolve the user for the me alias
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionNo right to manage the chat's guest links — Bitrix24 refused with the ACCESS_DENIED code
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only and the call is a write — see access rights
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured

The full list of general API errors — Errors.

Known specifics

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.

Guests who already joined are removed. Regeneration revokes the old link and removes from the chat guests who joined through it. Personal email and SMS invitations are not revoked and remain valid until dateExpire.

All members see a system message. Regeneration leaves a message in the chat saying that the old link no longer gives access to the chat.

The new link counts toward the invitation limit. A regenerated link counts toward the author's limit of 10 guest links per hour, which is checked by invitations by email and by SMS.

See also