
## Section fields

`GET /v1/product-sections/fields`

Returns the reference of product section fields with types and the "read-only" flag, plus the list of operations available in a [batch request](/docs/batch).

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/product-sections/fields" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/product-sections/fields" \
  -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/fields', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success, data } = await res.json()
console.log('Total fields:', Object.keys(data.fields).length)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections/fields', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

`data.fields` is an object whose key matches the field name and whose value contains `type` (the field type) and `readonly` (`true` — the field cannot be passed on create or update). `data.batch` is the list of operations accepted by a [batch request](/docs/batch).

| Field | Bitrix24 | Type | RO | Description |
|------|----------|-----|:--:|---------|
| `id` | `ID` | number | yes | Section identifier |
| `name` | `NAME` | string | | Section name |
| `catalogId` | `CATALOG_ID` | number | | Catalog identifier. List: `GET /v1/catalogs` |
| `sectionId` | `SECTION_ID` | number | | Parent section identifier for nesting. `null` for a root section |
| `xmlId` | `XML_ID` | string | | External identifier for synchronization |
| `sort` | `SORT` | number | | Sort order. Lower comes first |
| `code` | `CODE` | string | | Section symbolic code |

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.fields.<name>.type` | string | Field type: `number`, `string` |
| `data.fields.<name>.readonly` | boolean | `true` — the field is filled in by the system and not accepted on create and update |
| `data.batch` | string[] | Section operations available in a [batch request](/docs/batch): `create`, `update`, `delete` |

The `sort` field is accepted on create and update, but is not returned in `list`, `get`, and `search` responses and **cannot be filtered by** — it does work in sorting (`order`/`sort`). The other fields — `id`, `name`, `catalogId`, `sectionId`, `xmlId`, `code` — filter by exact match (and `$in`); operators return `400 UNSUPPORTED_FILTER`. The `sectionId`, `xmlId`, and `code` fields come back with a `null` value if not set. If `code` is not provided on create, it is generated from `name`.

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true },
      "name": { "type": "string", "readonly": false },
      "catalogId": { "type": "number", "readonly": false },
      "sectionId": { "type": "number", "readonly": false },
      "xmlId": { "type": "string", "readonly": false },
      "sort": { "type": "number", "readonly": false },
      "code": { "type": "string", "readonly": false }
    },
    "batch": ["create", "update", "delete"]
  }
}
```

## Error response example

403 — no scope:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not provided |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Create section](/docs/entities/product-sections/create)
- [List sections](/docs/entities/product-sections/list)
- [Product sections](/docs/entities/product-sections)
- [Entity API](/docs/entity-api)
