For AI agents: markdown of this page — /docs-content-en/chats/events/unsubscribe.md documentation index — /llms.txt

Unsubscribe from events

POST /v1/chats/events/unsubscribe

Stops accumulating messenger events for the current user. After unsubscribing, new events are no longer accumulated. If there was no subscription, the call does not return an error.

Parameters

The endpoint takes no parameters. The request body is an empty object {}.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/chats/events/unsubscribe" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

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

const { success, data } = await res.json()
console.log('Unsubscribe:', data) // true

JavaScript — OAuth application

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

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeboolean Descriptiontrue — unsubscribed successfully

Response example

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

Error response example

403 — no im scope:

JSON
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'im' scope"
  }
}

Errors

HTTP Code Description
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error (error text in message)
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error

Full list of common API errors — Errors.

Known specifics

OAuth key. For a vibe_app_… key add the Authorization: Bearer <session_token> header — without it the request returns 401 TOKEN_MISSING. Learn more — Keys and authorization.

See also