Para agentes de IA: markdown desta página — /docs-content-en/lists/sections.md índice da documentação — /llms.txt
Os artigos da documentação estão disponíveis atualmente em inglês.
Sections
Group list elements by sections: get the list of sections, create new ones, update and delete. Sections support nesting — a section can have a parent.
Bitrix24 API: lists.section.*
Scope: lists
List sections
GET /v1/lists/:iblockId/sections
Returns the sections of the specified list. Sections group elements and can form a tree — a section may have a parent section.
Parameters
| Parameter | Type | Req. | Default | Description |
|---|---|---|---|---|
iblockId (path) |
string | yes | — | Numeric IBLOCK_ID or the list's symbolic code. IDs are available via GET /v1/lists |
iblockTypeId (query) |
string | no | lists |
Infoblock type. Values:lists — regular lists, defaultlists_socnet — workgroup listsbitrix_processes — service workflowsstructure — company-structure type (holds the stock absence-calendar iblock absence) |
filter (query) |
object | no | — | Filter by section fields — ID, NAME, CODE, IBLOCK_SECTION_ID, SORT.Filtering syntax. Example: ?filter={"NAME":"Documents"} ⚠️ Pass the WHOLE filter in a single form — either bracket notation or one JSON object. A mixed envelope (?filter[NAME]=x&filter=) and a bracket condition deeper than two levels are rejected with 400 INVALID_FILTER: half of the conditions are irrecoverably lost while the query string is parsed. An empty ?filter= means "no filter". |
select (query) |
string | no | — | Comma-separated list of returned fields. Example: ?select=ID,NAME,CODE |
Examples
curl — personal key
curl https://vibecode.bitrix24.com/v1/lists/121/sections \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl https://vibecode.bitrix24.com/v1/lists/121/sections \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/lists/121/sections', {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data, meta } = await res.json()
console.log('Sections:', meta.total)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/lists/121/sections', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data } = await res.json()
Response fields
Response fields use the Bitrix24 format: upper-case keys with underscores, numeric values arrive as strings, unset fields are null.
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data |
array | Array of sections |
data[].ID |
string | Section ID |
data[].NAME |
string | Section name |
data[].IBLOCK_SECTION_ID |
string | Parent section ID. Arrives as null for a root section |
data[].SORT |
string | Sort index |
data[].CODE |
string | Section symbolic code |
meta.total |
number | Total number of sections matching the request |
Response example
{
"success": true,
"data": [
{
"ID": "137",
"NAME": "Sales department documents",
"IBLOCK_SECTION_ID": null,
"SORT": "100",
"CODE": "sales_docs"
},
{
"ID": "139",
"NAME": "Marketing department documents",
"IBLOCK_SECTION_ID": null,
"SORT": "200",
"CODE": "marketing_docs"
}
],
"meta": { "total": 2 }
}
Error response example
400 — the filter parameter is not valid JSON:
{
"success": false,
"error": {
"code": "INVALID_FILTER",
"message": "filter must be valid JSON, e.g. filter={\"NAME\":\"%urgent%\"}."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_FILTER |
filter is not valid JSON. An ambiguous envelope is rejected as well: the bracket form and JSON in one request (in either order), or a bracket condition deeper than two levels — half of the conditions are irrecoverably lost during parsing, so the request is refused rather than half-applied. |
| 400 | INVALID_IBLOCK_TYPE |
iblockTypeId is not in the allowed set |
| 403 | BITRIX_ACCESS_DENIED |
No rights to the list. On this address an absent list answers 422 — Bitrix24 words it as a complaint about a wrong infoblock type |
| 409 | LISTS_MODULE_NOT_ENABLED |
The "Lists" module is not enabled on the portal |
| 403 | SCOPE_DENIED |
The API key lacks the lists scope |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
Full list of common API errors — Errors.
Known specifics
The tree is reconstructed from IBLOCK_SECTION_ID. Sections arrive as a flat array. To build the tree, group sections by their IBLOCK_SECTION_ID value: for root sections it is null, for nested ones it is the parent section ID.