## Rename a notification group

`PATCH /v1/notifications/groups/:groupId`

Changes the name of a group the user created. The group's conditions do not change — they are edited with the [Add a condition to a notification group](/docs/notifications/groups/conditions-create) and [Remove a condition from a notification group](/docs/notifications/groups/conditions-delete) operations.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `groupId` (path) | number | yes | Group identifier — the `tag` value of a group with `isEditable: true` from the [group list](/docs/notifications/groups/list), passed as a number. The system groups `confirm`, `mention` and `admin` have no numeric identifier |

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `title` | string | yes | New group name, 1 to 255 characters |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/notifications/groups/12" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Work notifications" }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/notifications/groups/12" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Work notifications" }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/groups/12', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ title: 'Work notifications' }),
})

const { success } = await res.json()
console.log('Group renamed:', success)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/groups/12', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ title: 'Work notifications' }),
})

const { success } = await res.json()
console.log('Group renamed:', success)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.result` | boolean | Always `true`. The success indicator is the HTTP status `200`, not this value |

## Response example

HTTP 200:

```json
{
  "success": true,
  "data": {
    "result": true
  }
}
```

## Error response example

404 — the group does not exist:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Notification group was not found.",
    "b24Code": "GROUP_NOT_FOUND"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | `groupId` is not a positive integer, including a system group tag such as `mention` |
| 400 | `INVALID_PARAMS` | `title` was not passed, is not a string, is an empty string or is longer than 255 characters |
| 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. The field name is in `message` |
| 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` | Bitrix24 rejected the change. 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](/docs/errors).

## See also

- [List notification groups](/docs/notifications/groups/list)
- [Delete a notification group](/docs/notifications/groups/delete)
- [Add a condition to a notification group](/docs/notifications/groups/conditions-create)
