For AI agents: markdown of this page — /docs-content-en/entities/product-sections/update.md documentation index — /llms.txt

Update section

PATCH /v1/product-sections/:id

Updates an existing product catalog section. Only the fields being changed are passed in the body. Fields are passed flat at the root of the JSON, without a fields wrapper.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionSection identifier

Request fields (body)

Field Type Required Description
Fieldname Typestring Requiredno DescriptionSection name
FieldcatalogId Typenumber Requiredno DescriptionCatalog identifier. List: GET /v1/catalogs
FieldsectionId Typenumber Requiredno DescriptionParent section identifier for nesting. null for a top-level section. List: GET /v1/product-sections
Fieldcode Typestring Requiredno DescriptionSection symbolic code
FieldxmlId Typestring Requiredno DescriptionExternal identifier
Fieldsort Typenumber RequiredRO DescriptionSort order. Bitrix24 does not save the value passed here (and still reports success), so the field is rejected with 400 READONLY_FIELD — change the order in the Bitrix24 interface
Fieldid Typenumber RequiredRO DescriptionSection identifier. Filled in by the system

Examples

curl — personal key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/product-sections/197" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Outerwear"
  }'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/product-sections/197" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Outerwear"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/197', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Outerwear',
  }),
})

const { success, data } = await res.json()
console.log('Updated name:', data.name)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/197', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Outerwear',
  }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionThe section after the update
Fielddata.id Typenumber DescriptionSection identifier
Fielddata.name Typestring DescriptionSection name
Fielddata.catalogId Typenumber DescriptionCatalog identifier. List: GET /v1/catalogs
Fielddata.sectionId Typenumber DescriptionParent section identifier or null. List: GET /v1/product-sections
Fielddata.xmlId Typestring DescriptionExternal identifier or null
Fielddata.code Typestring DescriptionSection symbolic code
Fieldmeta.warnings Typearray DescriptionPresent only when the body contains a field that is not among the section fields. The other fields are still updated. Each element carries code: "UNRECOGNIZED_WRITE_FIELD", field with the field name, and message

Response example

JSON
{
  "success": true,
  "data": {
    "id": 197,
    "name": "Outerwear",
    "catalogId": 25,
    "sectionId": null,
    "xmlId": null,
    "code": "outerwear"
  }
}

Error response example

404 — section not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Product section is not found."
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionA section with the specified id does not exist
HTTP400 CodeREADONLY_FIELD DescriptionA read-only field was passed in the body — id or sort
HTTP403 CodeSCOPE_DENIED DescriptionThe key is missing the crm scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided

Full list of common API errors — Errors.

See also