
## Knowledge bases list

`GET /v1/note/collections`

Returns the knowledge bases available to the current API key in the Bitrix24 account. Supports cursor pagination for traversing large lists.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `limit` (query) | integer | no | Page size. Defaults to 50, from 1 to 200 |
| `afterPosition` (query) | integer | no | The `position` value from `meta.nextCursor` of the previous response. Passed together with `afterId` |
| `afterId` (query) | integer | no | The `id` value from `meta.nextCursor` of the previous response. Passed together with `afterPosition` |

**Pagination.** Cursor-based. `limit` sets the page size. For the next page, pass `afterPosition` and `afterId` from `meta.nextCursor` of the previous response. When `meta.nextCursor` is `null`, there are no more pages.

## Examples

### curl — personal key

```bash
curl https://vibecode.bitrix24.com/v1/note/collections \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl https://vibecode.bitrix24.com/v1/note/collections \
  -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/note/collections', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log('Knowledge bases:', data)
```

### JavaScript — OAuth application

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of knowledge bases |
| `data[].id` | number | Knowledge base identifier |
| `data[].name` | string | Knowledge base name |
| `data[].position` | number | Numeric position of the knowledge base |
| `data[].policyLevel` | string | Access policy level of the knowledge base, for example `none` |
| `data[].createdBy` | number | Identifier of the employee who created the knowledge base. List: `GET /v1/users` |
| `data[].createdAt` | string | Creation date in ISO 8601 format |
| `data[].updatedBy` | number | Identifier of the employee who last modified the knowledge base. List: `GET /v1/users` |
| `data[].updatedAt` | string | Last modification date in ISO 8601 format |
| `meta.nextCursor` | object or null | Next page cursor — an object with `position` and `id` fields. `null` when there are no more pages |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "My company",
      "position": 1000,
      "policyLevel": "none",
      "createdBy": 0,
      "createdAt": "2026-05-21T17:36:10Z",
      "updatedBy": 0,
      "updatedAt": "2026-05-21T17:36:10Z"
    },
    {
      "id": 9,
      "name": "Product documentation",
      "position": 100,
      "policyLevel": "none",
      "createdBy": 1269,
      "createdAt": "2026-06-23T19:01:03Z",
      "updatedBy": 1269,
      "updatedAt": "2026-06-23T19:05:39Z"
    },
    {
      "id": 7,
      "name": "KB test",
      "position": 100,
      "policyLevel": "none",
      "createdBy": 1269,
      "createdAt": "2026-06-22T09:16:33Z",
      "updatedBy": 1269,
      "updatedAt": "2026-06-22T09:16:33Z"
    }
  ],
  "meta": { "nextCursor": null }
}
```

## Error response example

400 — invalid `limit`:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "`limit` must be an integer between 1 and 200"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `limit` outside the range from 1 to 200, or only one of `afterPosition` / `afterId` was passed |
| 403 | `SCOPE_DENIED` | The key lacks the `note` scope |
| 401 | `TOKEN_MISSING` | The key has no configured tokens |

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

## See also

- [Get a knowledge base](/docs/note/collections/get)
- [Document tree](/docs/note/collections/tree)
- [Knowledge bases](/docs/note/collections)
- [Limits and optimization](/docs/optimization)
