สำหรับเอเจนต์ AI: markdown ของหน้านี้ — /docs-content-en/notifications/groups.md ดัชนีเอกสาร — /llms.txt

บทความในเอกสารมีให้บริการเป็นภาษาอังกฤษในขณะนี้

Notification groups

A notification group selects a user's notifications by the module and the event they came from. A module and event pair is a group condition. The operations list groups, create a group with its first condition, rename and delete it, add and remove conditions.

Scope: im | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key

List notification groups

GET /v1/notifications/groups

Returns the user's notification groups: system ones and the ones the user created. Call it before changing a group to learn its identifier and current conditions.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/notifications/groups" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

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

const { data } = await res.json()
const ownGroups = data.items.filter((group) => group.isEditable)
console.log('Own groups:', ownGroups.length)

JavaScript — OAuth application

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

const { data } = await res.json()
const ownGroups = data.items.filter((group) => group.isEditable)
console.log('Own groups:', ownGroups.length)

Response fields

Field Type Description
success boolean Always true on success
data.items array Notification groups: system ones first, followed by the ones the user created
data.items[].tag string Group identifier. For a system group it is a tag: confirm, mention or admin. For a user group it is a numeric identifier as a string, for example "12". It is passed as a number in the :groupId path parameter of Rename a notification group, Delete a notification group, Add a condition to a notification group and Remove a condition from a notification group
data.items[].title string Group name
data.items[].isEditable boolean false for a system group — it cannot be renamed or deleted, and its conditions cannot be changed. true for a user group
data.items[].conditions object Conditions by which the group selects notifications
data.items[].conditions.notifyType number Present only on the confirm group. The value 1 means the group selects confirmation requests — notifications with reply buttons
data.items[].conditions.moduleConditions object Conditions by module. The key is the module identifier as is, for example tasks or vendor.my_module. The all key is a condition without a module
data.items[].conditions.moduleConditions.<module>.isWhole boolean true — the group selects all events of the module, and the events list does not restrict the selection. false — only the events listed in events
data.items[].conditions.moduleConditions.<module>.events array Identifiers of the module events the group selects

Response example

HTTP 200:

JSON
{
  "success": true,
  "data": {
    "items": [
      {
        "tag": "confirm",
        "title": "Require action",
        "conditions": { "notifyType": 1 },
        "isEditable": false
      },
      {
        "tag": "mention",
        "title": "I was mentioned",
        "conditions": {
          "moduleConditions": {
            "all": { "isWhole": false, "events": ["mention", "mention_comment"] }
          }
        },
        "isEditable": false
      },
      {
        "tag": "12",
        "title": "Tasks and calendar",
        "conditions": {
          "moduleConditions": {
            "tasks": { "isWhole": false, "events": ["comment"] },
            "calendar": { "isWhole": false, "events": ["invite"] }
          }
        },
        "isEditable": true
      }
    ]
  }
}

Error response example

400 — a query parameter was passed:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Query parameter `limit` is not accepted by GET /v1/notifications/groups. It takes no query parameters."
  }
}

Errors

HTTP Code Description
400 INVALID_PARAMS A query parameter was passed — the operation does not accept query parameters. The parameter name is in message
422 BITRIX_ERROR Bitrix24 rejected the request; the portal code is in the error.b24Code field
403 SCOPE_DENIED The key lacks the im scope
401 TOKEN_MISSING The key has no configured tokens

Full list of common API errors — Errors.

Known specifics

  • Groups belong to the user on whose behalf the call is made. With a personal key, this is the key owner; with an OAuth application key, it is the session user from the Authorization: Bearer header. All group operations and group conditions work with the groups of the same user.

See also