
## List sections

`GET /v1/product-sections`

Returns product catalog sections with filtering and auto-pagination support. These are the same sections available via [`GET /v1/catalog-sections`](/docs/entities/catalog-sections) — with the same `id`.

## Parameters

| Parameter | Type | Default | Description |
|----------|-----|-----------|---------|
| `limit` | number | `50` | Number of records, up to 5000. When `limit > 50`, Vibecode assembles several pages into one response |
| `offset` | number | `0` | Offset from the start of the selection |
| `select` | string | — | Field selection: `?select=id,name,sectionId` |
| `sort` | string | — | Sorting by `name`, `sort`, `code`, `xmlId`, `catalogId`, `sectionId`: `?sort=name`, a minus sign means descending: `?sort=-name` |
| `order` | object | — | Sorting as an object: `?order[name]=desc`. If `sort` is passed, it takes precedence |
| `include` | string | — | Related data: `catalog`, `parentSection`. See the "Related data" section |
| `withTotal` | string | — | Accepts `true` or `false`, but does not change counting or the presence of `meta.total` for product sections |
| `filter` | object | — | Filtering by the fields of [`GET /v1/product-sections/fields`](/docs/entities/product-sections/fields). Exact-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`.<br>[Filtering syntax](/docs/filtering). Example: `?filter[sectionId]=31`. Filtering by `catalogId` does not narrow the selection — see "Known specifics" |

## Examples

### curl — personal key

```bash
curl -g "https://vibecode.bitrix24.com/v1/product-sections?filter[sectionId]=31&limit=10" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -g "https://vibecode.bitrix24.com/v1/product-sections?filter[sectionId]=31&limit=10" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections?filter[sectionId]=31&limit=10', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(`Found ${meta.total} sections`)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections?filter[sectionId]=31&limit=10', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of sections |
| `data[].id` | number | Section identifier |
| `data[].name` | string | Section name |
| `data[].catalogId` | number | ID of the catalog the section belongs to. Source: [`GET /v1/catalogs`](/docs/entities/catalogs/list) |
| `data[].sectionId` | number \| null | Parent section ID — the `id` of another section from this same list. Source: `GET /v1/product-sections`. `null` for a top-level section |
| `data[].code` | string \| null | Section symbolic code |
| `data[].xmlId` | string \| null | External identifier |
| `meta.total` | number | Total number of records matching the filter |
| `meta.hasMore` | boolean | Whether more records exist beyond `limit` |

The `sort` field is not returned in the list response. For the full set of section fields, see [`GET /v1/product-sections/fields`](./fields.md).

## Related data

To retrieve related records together with the list, use the `include` parameter:

```
GET /v1/product-sections?limit=1&include=catalog,parentSection
```

Available `include` values: `catalog` — the product catalog the section belongs to, and `parentSection` — the parent section. The `catalog` include reads catalogs, so the key needs the `catalog` scope. For a top-level section, `parentSection` comes back as `null`. The result is in the `_included` field of each `data[]` element:

```json
{
  "success": true,
  "data": [
    {
      "id": 31,
      "catalogId": 25,
      "sectionId": null,
      "name": "Clothing",
      "code": "clothes",
      "xmlId": "666",
      "_included": {
        "catalog": {
          "iblockId": 25,
          "iblockTypeId": "CRM_PRODUCT_CATALOG",
          "id": 25,
          "lid": "s1",
          "name": "CRM product catalog",
          "productIblockId": null,
          "skuPropertyId": null,
          "subscription": "N",
          "vatId": 1,
          "yandexExport": false
        },
        "parentSection": null
      }
    }
  ],
  "meta": {
    "total": 37,
    "hasMore": true
  }
}
```


More on the `include` parameter: [Related data](/docs/includes).

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 33,
      "catalogId": 25,
      "sectionId": 31,
      "name": "Footwear",
      "code": "shoes",
      "xmlId": "19"
    },
    {
      "id": 39,
      "catalogId": 25,
      "sectionId": 31,
      "name": "Dresses",
      "code": "dresses",
      "xmlId": "20"
    }
  ],
  "meta": {
    "total": 6,
    "hasMore": false
  }
}
```

## Error response example

403 — no scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'crm' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `UNSUPPORTED_FILTER` | An operator or a non-filterable field in the filter. Filter by exact match or `$in` on `id`, `name`, `xmlId`, `code`, `sectionId`. The filter also accepts `catalogId` without an error, but it does not narrow the selection |
| 400 | `INVALID_FILTER` | Error in filter syntax |
| 400 | `INVALID_INCLUDE` | Unknown name in `include`. The message lists the available ones: `catalog`, `parentSection` |
| 403 | `SCOPE_DENIED` | The key is missing the `crm` scope |
| 403 | `SCOPE_DENIED` | `include=catalog` was passed, but the key lacks the `catalog` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not provided |
| 429 | `RATE_LIMITED` | Rate 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](/docs/errors).

## Known specifics

**Exact match only.** The filter uses exact match (and `$in` sets) on `id`, `name`, `xmlId`, `code`, `sectionId`. Operators (`>`, `<`, `!`, `%`), `$ne`/`$contains`/`$nin` and filtering by `sort` return `400 UNSUPPORTED_FILTER` — so you see immediately that the filter did not apply, instead of getting the whole list unfiltered. The one exception is `catalogId`: the filter accepts it without an error, but it does not narrow the selection — see "Only sections of the CRM product catalog" below.

**Sections of one parent.** To get nested sections inside a specific section, filter by exact match on `filter[sectionId]` with the parent identifier.

**Only sections of the CRM product catalog.** The method returns sections of the CRM product catalog — its ID comes in the `catalogId` field of every section. With the `catalogId` of an offers catalog or of a catalog that does not exist, the method returns all sections of the CRM product catalog, as if no filter were set, rather than an empty list. `$in` on `catalogId` does not narrow the selection either. Sections of another catalog are returned by [`GET /v1/catalog-sections`](/docs/entities/catalog-sections/list) with `filter[iblockId]`.

## See also

- [Get section](/docs/entities/product-sections/get)
- [Create section](/docs/entities/product-sections/create)
- [Search sections](/docs/entities/product-sections/search)
- [Section fields](/docs/entities/product-sections/fields)
- [Catalog sections](/docs/entities/catalog-sections)
- [Filtering syntax](/docs/filtering)
- [Limits and optimization](/docs/optimization)
