For AI agents: markdown of this page — /docs-content-en/notifications/groups/conditions-create.md documentation index — /llms.txt
Add a condition to a notification group
POST /v1/notifications/groups/:groupId/conditions
Adds one more module and event pair to a group the user created. From then on, the group also selects notifications of this event.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupId (path) |
number | yes | Group identifier — the tag value of a group with isEditable: true from the group list, passed as a number. The system groups confirm, mention and admin have no numeric identifier |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
module |
string | yes | Module identifier, 1 to 255 characters. The list of modules is the data[].id field in the notification settings; the module of a specific notification is the notifyModule field in the notification feed |
event |
string | yes | Identifier of an event of this module, 1 to 255 characters. The module's events are the data[].notices[].id field in the notification settings; the event of a specific notification is the notifyEvent field in the notification feed |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/notifications/groups/12/conditions" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "module": "calendar", "event": "invite" }'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/notifications/groups/12/conditions" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "module": "calendar", "event": "invite" }'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/groups/12/conditions', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ module: 'calendar', event: 'invite' }),
})
const { data } = await res.json()
console.log('Condition ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/groups/12/conditions', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ module: 'calendar', event: 'invite' }),
})
const { data } = await res.json()
console.log('Condition ID:', data.id)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data.id |
number | Condition identifier. You do not need it to remove the condition — a condition is identified by its module and event pair |
Response example
HTTP 200:
{
"success": true,
"data": {
"id": 31
}
}
Error response example
422 — the group already has this condition:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Mysql query error: (1062) Duplicate entry '12-calendar-invite' for key 'b_im_notify_group_condition.UX_IM_NOTIFY_GROUP_CONDITION_GROUP_ID_MODULE_EVENT'",
"b24Code": "400"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS |
groupId is not a positive integer, including a system group tag such as mention |
| 400 | INVALID_PARAMS |
module or event was not passed, is not a string, is an empty string or is longer than 255 characters. The field name is in message |
| 400 | INVALID_PARAMS |
A body field not listed in the table above or a query parameter was passed, or the body is not a JSON object |
| 404 | ENTITY_NOT_FOUND |
The group does not exist — it was deleted or belongs to another user. The portal code GROUP_NOT_FOUND is in the error.b24Code field. On a portal whose interface language is neither Russian nor English, the same refusal arrives as 422 BITRIX_ERROR — rely on error.b24Code |
| 422 | BITRIX_ERROR |
The group already has this condition. error.b24Code holds 400, and message holds the Bitrix24 database error text about a duplicate entry. A duplicate has no separate code — check the group's contents in the group list before adding |
| 422 | BITRIX_ERROR |
Bitrix24 rejected the addition for another reason; the portal code is in the error.b24Code field |
| 403 | SCOPE_DENIED |
The key lacks the im scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is in read-only mode |
| 401 | TOKEN_MISSING |
The key has no configured tokens |
Full list of common API errors — Errors.