[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-notifications\u002Fgroups\u002Fconditions-create":3,"docs-tabs-notifications\u002Fgroups\u002Fconditions-create":6},{"content":4,"lastmod":5},"## Add a condition to a notification group\n\n`POST \u002Fv1\u002Fnotifications\u002Fgroups\u002F:groupId\u002Fconditions`\n\nAdds one more module and event pair to a group the user created. From then on, the group also selects notifications of this event.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `groupId` (path) | number | yes | Group identifier — the `tag` value of a group with `isEditable: true` from the [group list](\u002Fdocs\u002Fnotifications\u002Fgroups\u002Flist), passed as a number. The system groups `confirm`, `mention` and `admin` have no numeric identifier |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `module` | string | yes | Module identifier, 1 to 255 characters. The list of modules is the `data[].id` field in the [notification settings](\u002Fdocs\u002Fnotifications\u002Fsettings\u002Flist); the module of a specific notification is the `notifyModule` field in the [notification feed](\u002Fdocs\u002Fnotifications\u002Flist) |\n| `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](\u002Fdocs\u002Fnotifications\u002Fsettings\u002Flist); the event of a specific notification is the `notifyEvent` field in the [notification feed](\u002Fdocs\u002Fnotifications\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fnotifications\u002Fgroups\u002F12\u002Fconditions\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"module\": \"calendar\", \"event\": \"invite\" }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fnotifications\u002Fgroups\u002F12\u002Fconditions\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"module\": \"calendar\", \"event\": \"invite\" }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fnotifications\u002Fgroups\u002F12\u002Fconditions', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ module: 'calendar', event: 'invite' }),\n})\n\nconst { data } = await res.json()\nconsole.log('Condition ID:', data.id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fnotifications\u002Fgroups\u002F12\u002Fconditions', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ module: 'calendar', event: 'invite' }),\n})\n\nconst { data } = await res.json()\nconsole.log('Condition ID:', data.id)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.id` | number | Condition identifier. You do not need it to [remove the condition](\u002Fdocs\u002Fnotifications\u002Fgroups\u002Fconditions-delete) — a condition is identified by its `module` and `event` pair |\n\n## Response example\n\nHTTP 200:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 31\n  }\n}\n```\n\n## Error response example\n\n422 — the group already has this condition:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"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'\",\n    \"b24Code\": \"400\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `groupId` is not a positive integer, including a system group tag such as `mention` |\n| 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` |\n| 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 |\n| 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` |\n| 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](\u002Fdocs\u002Fnotifications\u002Fgroups\u002Flist) before adding |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the addition for another reason; the portal code is in the `error.b24Code` field |\n| 403 | `SCOPE_DENIED` | The key lacks the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |\n| 401 | `TOKEN_MISSING` | The key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Notification groups](\u002Fdocs\u002Fnotifications\u002Fgroups)\n- [Remove a condition from a notification group](\u002Fdocs\u002Fnotifications\u002Fgroups\u002Fconditions-delete)\n- [Create a notification group](\u002Fdocs\u002Fnotifications\u002Fgroups\u002Fcreate)\n- [Get notification settings](\u002Fdocs\u002Fnotifications\u002Fsettings\u002Flist)\n","2026-10-09",{},1795415484621]