## Rename a knowledge base

`PATCH /v1/note/collections/:id`

Changes the name of an existing knowledge base. The body is passed flat, without a `fields` wrapper.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | integer | yes | Knowledge base identifier |

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `name` | string | yes | New knowledge base name |

## Examples

### curl — personal key

```bash
curl -X PATCH https://vibecode.bitrix24.com/v1/note/collections/42 \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product docs"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH https://vibecode.bitrix24.com/v1/note/collections/42 \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product docs"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/note/collections/42', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Product docs',
  }),
})

const { success, data } = await res.json()
console.log('Renamed:', data.updated)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/note/collections/42', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Product docs',
  }),
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data.updated` | boolean | `true` on successful rename |

## Response example

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

## Error response example

400 — `name` not provided:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "`name` is required and must be a non-empty string"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `name` not provided, or `id` is not a positive integer |
| 404 | `ENTITY_NOT_FOUND` | The knowledge base does not exist, is deleted, or is archived |
| 403 | `BITRIX_ACCESS_DENIED` | No permission to manage this knowledge base |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |
| 403 | `SCOPE_DENIED` | The key is missing the `note` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key operates in read-only mode |
| 401 | `TOKEN_MISSING` | The key has no configured tokens |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Create a knowledge base](/docs/note/collections/create)
- [List knowledge bases](/docs/note/collections/list)
- [Knowledge bases](/docs/note/collections)
