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
success boolean Always true on success
data boolean true — 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
403 SCOPE_DENIED The API key does not have the im scope
401 TOKEN_MISSING The API key has no configured tokens
422 BITRIX_ERROR Bitrix24 returned an error (error text in message)
502 BITRIX_UNAVAILABLE Bitrix24 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