For AI agents: markdown of this page — /docs-content-en/note/collections.md documentation index — /llms.txt
Knowledge bases
A knowledge base is a container of documents in Bitrix24 Knowledge Base 2.0. In API paths it is called collection, while in the Bitrix24 interface it is a knowledge base. This section collects the operations for creating, reading, renaming, archiving, and deleting knowledge bases, as well as getting their document tree.
Scope: note | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key
Create a knowledge base
POST /v1/note/collections
Creates a knowledge base — a container for documents in Bitrix24 Knowledge Base 2.0. The body is passed flat, without a fields wrapper.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Knowledge base name |
position |
integer | no | Position in the list. Sorted by descending value. Defaults to 0 — the knowledge base is placed at the top of the list |
Examples
curl — personal key
curl -X POST https://vibecode.bitrix24.com/v1/note/collections \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Product documentation",
"position": 100
}'
curl — OAuth application
curl -X POST https://vibecode.bitrix24.com/v1/note/collections \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Product documentation",
"position": 100
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/note/collections', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Product documentation',
position: 100,
}),
})
const { success, data } = await res.json()
console.log('Knowledge base ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/note/collections', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Product documentation',
position: 100,
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
data.id |
number | Identifier of the created knowledge base |
Response example
{
"success": true,
"data": {
"id": 42
}
}
Error response example
400 — name not provided:
{
"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 position is not a non-negative integer |
| 403 | BITRIX_ACCESS_DENIED |
No permission to create knowledge bases on the Bitrix24 portal |
| 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.