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

Search sections

POST /v1/product-sections/search

Search product sections with filtering and auto-pagination. Equivalent to GET /v1/product-sections with filters, but via POST — more convenient for complex queries with many conditions.

Request fields (body)

Parameter Type Default Description
Parameterfilter Typeobject Default— DescriptionExact-match and $in (IN set) only, by id, name, xmlId, code, catalogId, sectionId. Operators (>, <, !, %, $ne, $contains, $nin) and filtering by sort are not supported — you get 400 UNSUPPORTED_FILTER.
Filtering syntax. Example: { "filter": { "catalogId": 25 } }
Parameterlimit Typenumber Default50 DescriptionNumber of records (up to 5000)
Parameterselect Typestring[] Default— DescriptionField selection: ["id", "name", "catalogId"]
Parameterorder Typeobject Default— DescriptionSorting by field: { "sort": "asc" }

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/product-sections/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "catalogId": 25 },
    "limit": 10,
    "select": ["id", "name", "catalogId", "code"]
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/product-sections/search" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "catalogId": 25 },
    "limit": 10,
    "select": ["id", "name", "catalogId", "code"]
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { catalogId: 25 },
    limit: 10,
    select: ['id', 'name', 'catalogId', 'code'],
  }),
})

const { success, data, meta } = await res.json()
console.log('Found:', meta.total)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { catalogId: 25 },
    limit: 10,
    select: ['id', 'name', 'catalogId', 'code'],
  }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionArray of sections
Fielddata[].id Typenumber DescriptionSection identifier
Fielddata[].name Typestring DescriptionSection name
Fielddata[].catalogId Typenumber DescriptionCatalog identifier
Fielddata[].sectionId Typenumber DescriptionParent section identifier. null for a root section
Fielddata[].code Typestring DescriptionSection symbolic code
Fielddata[].xmlId Typestring DescriptionExternal identifier
Fieldmeta.total Typenumber DescriptionTotal number of records matching the filter
Fieldmeta.hasMore Typeboolean DescriptionWhether more records exist beyond limit
Fieldmeta.durationMs Typenumber DescriptionRequest duration in milliseconds

The meta fields sit next to data, not inside it. Page through the results using meta.hasMore: a data length equal to limit does not rule out the last page.

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": 31,
      "catalogId": 25,
      "sectionId": null,
      "name": "Clothing",
      "code": "clothes",
      "xmlId": "666"
    },
    {
      "id": 45,
      "catalogId": 25,
      "sectionId": null,
      "name": "Filter section",
      "code": "filter-section",
      "xmlId": null
    }
  ],
  "meta": {
    "total": 37,
    "hasMore": true,
    "durationMs": 285
  }
}

Error response example

400 — an operator or a non-filterable field in the filter:

JSON
{
  "success": false,
  "error": {
    "code": "UNSUPPORTED_FILTER",
    "message": "UNSUPPORTED_FILTER: operators are not supported on 'product-sections' (near 'name'). Its Bitrix24 method (crm.productsection.list) filters by exact match only — operators are silently ignored by Bitrix24. Use exact match (field: value) or $in (field: {$in: [...]}) on: id, name, xmlId, code, catalogId, sectionId."
  }
}

Errors

HTTP Code Description
HTTP400 CodeUNSUPPORTED_FILTER DescriptionAn operator or a non-filterable field in the filter. Filter by exact match or $in on id, name, xmlId, code, catalogId, sectionId
HTTP400 CodeINVALID_FILTER DescriptionError while parsing the filter
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the crm scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided
HTTP429 CodeRATE_LIMITED DescriptionRate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the x-ratelimit-limit header. Retry after the delay in the Retry-After header

For the full list of common API errors, see Errors.

Known specifics

Auto-pagination. When limit > 50 the request is split into several calls to the server. The maximum is 5000 records per call. If more match the filter, meta.hasMore will be true.

Exact match only in the filter. The method filters by exact match (and $in) on id, name, xmlId, code, catalogId, sectionId. Operators, $ne/$contains/$nin and filtering by sort return 400 UNSUPPORTED_FILTER. Sorting (order) by sort and other fields works.

See also