لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/catalog-sections.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Catalog sections
Product catalog sections: list, get, create, update, and delete. Sections form a tree inside a catalog — a section may have a parent section. Each section is bound to a catalog via the iblockId field.
Bitrix24 API: catalog.section.*
Scope: catalog
Create a section
POST /v1/catalog-sections
Creates a catalog section. Fields are passed flat at the JSON root.
Request fields (body)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
FieldiblockId |
Typenumber | Requiredyes | Default— | DescriptionID of the catalog the section belongs to. List: GET /v1/catalogs |
Fieldname |
Typestring | Requiredyes | Default— | DescriptionSection name |
FieldiblockSectionId |
Typenumber | Requiredno | Defaultnull |
DescriptionParent section ID. null — top-level section. List: GET /v1/catalog-sections |
Fieldcode |
Typestring | Requiredno | Defaultnull |
DescriptionSection symbolic code |
FieldxmlId |
Typestring | Requiredno | Defaultnull |
DescriptionExternal identifier |
Fieldsort |
Typenumber | Requiredno | Default500 |
DescriptionSort index |
Fieldactive |
Typeboolean | Requiredno | Defaulttrue |
DescriptionWhether the section is active |
Fielddescription |
Typestring | Requiredno | Defaultnull |
DescriptionSection description |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-sections" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"iblockId": 25,
"name": "New arrivals",
"sort": 100
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-sections" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"iblockId": 25,
"name": "New arrivals",
"sort": 100
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-sections', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
iblockId: 25,
name: 'New arrivals',
sort: 100,
}),
})
const { success, data } = await res.json()
console.log('Section ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-sections', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
iblockId: 25,
name: 'New arrivals',
sort: 100,
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typeobject | DescriptionFull object of the created section |
Fielddata.id |
Typenumber | DescriptionIdentifier of the created section |
Fielddata.iblockId |
Typenumber | DescriptionCatalog ID. List: GET /v1/catalogs |
Fielddata.iblockSectionId |
Typenumber | null | DescriptionParent section ID. null — top-level section. List: GET /v1/catalog-sections |
Fielddata.name |
Typestring | DescriptionSection name |
Fielddata.code |
Typestring | null | DescriptionSection symbolic code |
Fielddata.xmlId |
Typestring | null | DescriptionExternal identifier |
Fielddata.sort |
Typenumber | DescriptionSort index |
Fielddata.active |
Typeboolean | DescriptionWhether the section is active |
Fielddata.description |
Typestring | null | DescriptionSection description |
Fielddata.descriptionType |
Typestring | DescriptionDescription format: text or html |
Response example
{
"success": true,
"data": {
"active": true,
"code": null,
"description": null,
"descriptionType": "text",
"iblockId": 25,
"iblockSectionId": null,
"id": 215,
"name": "New arrivals",
"sort": 100,
"xmlId": null
}
}
Error response example
422 — a required field was not passed:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Required fields: name"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP422 | CodeBITRIX_ERROR |
DescriptionA required field was not passed — the message names the missing one (Required fields: iblockId or Required fields: name) |
| HTTP400 | CodeREADONLY_FIELD |
Descriptionid was passed in the body — this field is set by the system and is not accepted on creation |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the catalog scope |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionX-Api-Key was not passed |
Full list of common API errors — Errors.