For AI agents: markdown of this page — /docs-content-en/entities/product-sections/create.md documentation index — /llms.txt
Create section
POST /v1/product-sections
Creates a new section in the product catalog. Fields are passed flat at the root of the JSON, without a fields wrapper.
Request fields (body)
| Field | Bitrix24 | Type | Required | Description |
|---|---|---|---|---|
name |
NAME |
string | yes | Section name |
catalogId |
CATALOG_ID |
number | no | Catalog identifier. If omitted, the Bitrix24 account CRM product catalog is used. List: GET /v1/catalogs |
sectionId |
SECTION_ID |
number | no | Parent section identifier for nesting. null for a top-level section |
code |
CODE |
string | no | Section symbolic code. If omitted, it is generated from name |
xmlId |
XML_ID |
string | no | External identifier |
sort |
SORT |
number | no | Sort index |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/product-sections" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Clothing",
"catalogId": 25
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/product-sections" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Clothing",
"catalogId": 25
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Clothing',
catalogId: 25,
}),
})
const { success, data } = await res.json()
console.log('Section ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Clothing',
catalogId: 25,
}),
})
const { success, data } = await res.json()
Response fields
The full object of the created section is returned.
| Field | Type | Description |
|---|---|---|
id |
number | Identifier of the created section |
name |
string | Section name |
catalogId |
number | Catalog identifier |
sectionId |
number | Parent section identifier or null |
xmlId |
string | External identifier or null |
code |
string | Section symbolic code |
Response example
{
"success": true,
"data": {
"id": 197,
"name": "Clothing",
"catalogId": 25,
"sectionId": null,
"xmlId": null,
"code": "clothing"
}
}
Error response example
422 — section name not provided:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Section name is not specified."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 422 | BITRIX_ERROR |
The name field was not provided — message "Section name is not specified." |
| 400 | READONLY_FIELD |
A read-only field was passed in the body — id |
| 403 | SCOPE_DENIED |
Key is missing the crm scope |
| 401 | MISSING_API_KEY |
The X-Api-Key header was not provided |
Full list of common API errors — Errors.