
## List preset fields

`GET /v1/requisite-presets/:presetId/fields`

Returns the list of fields that make up a requisite preset. The fields describe what a requisite consists of: INN, OGRN, director, KPP, and others.

## Parameters

| Parameter | Type | Required | Default | Description |
|----------|-----|:-----:|-----------|---------|
| `presetId` (path) | number | yes | — | Requisite preset ID. Get the list of presets: `GET /v1/requisite-presets` |
| `limit` | number | no | `50` | Number of records (up to 5000) |
| `offset` | number | no | `0` | Skip N records |
| `filter` | object | no | — | Exact-match field filter, e.g. `filter[fieldName]=RQ_INN`. Available fields: `id`, `fieldName`, `fieldTitle`, `inShortList`, `sort`. An unknown field returns `400 UNKNOWN_FILTER_FIELD` |
| `sort` | string | no | — | Sort field: `id`, `fieldName`, `fieldTitle`, `inShortList`, `sort`. Direction is set in `order` |
| `order` | string | no | `asc` | Sort direction: `asc` or `desc` |

## Examples

### curl — personal key

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

### curl — OAuth app

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

const { success, data, meta } = await res.json()
console.log(`Fields in preset: ${meta.total}`)
```

### JavaScript — OAuth app

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/requisite-presets/1/fields', {
  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 preset field rows |
| `data[].id` | number | ID of the field row within the preset |
| `data[].fieldName` | string | System name of the requisite field: `RQ_INN`, `RQ_COMPANY_NAME`, etc. |
| `data[].fieldTitle` | string | Custom field title. An empty string means the default title is used |
| `data[].inShortList` | boolean | Whether the field is shown in the short requisite list |
| `data[].sort` | number | Sort order of the field within the preset |
| `meta.total` | number | Number of records in the set: with `filter` — after filtering, without `filter` — all fields in the preset |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` in this set |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "fieldName": "RQ_INN",
      "fieldTitle": "",
      "inShortList": true,
      "sort": 500
    },
    {
      "id": 2,
      "fieldName": "RQ_COMPANY_NAME",
      "fieldTitle": "",
      "inShortList": true,
      "sort": 510
    },
    {
      "id": 3,
      "fieldName": "RQ_COMPANY_FULL_NAME",
      "fieldTitle": "",
      "inShortList": false,
      "sort": 520
    }
  ],
  "meta": {
    "total": 13,
    "hasMore": false
  }
}
```

## Error response example

404 — preset not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "The Preset with ID '999999' is not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PRESET_ID` | The provided `presetId` is not a positive integer |
| 400 | `UNKNOWN_FILTER_FIELD` | `filter` names a field outside `id`, `fieldName`, `fieldTitle`, `inShortList`, `sort` |
| 400 | `UNKNOWN_SORT_FIELD` | `sort` names a field outside the same list |
| 400 | `INVALID_FILTER_OPERATOR` | `filter` uses an operator — only exact equality is supported |
| 404 | `ENTITY_NOT_FOUND` | No preset with the given `presetId` found |
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

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

## Known specifics

**A field identifier is positional — do not rely on a stored value between write operations.** `data[].id` is a positional identifier of a field row within the preset. It may change when the preset composition is modified — after fields are added or removed. To update or delete a field, re-read the list and find the row by `fieldName` rather than by a previously stored `id`.

**The `inShortList` flag is a boolean.** The field is returned as `true` or `false`, not `Y`/`N`.

**`fieldTitle` is empty in the list until the title is overridden.** The default name — "INN" for `RQ_INN`, "Contact person" for `RQ_CONTACT` — is returned when you read a single row: [`GET /v1/requisite-presets/:presetId/fields/:id`](/docs/entities/requisite-presets/preset-fields/get). In the list, the same field comes back with `fieldTitle: ""`.

**Pagination is applied on the Vibecode side.** Vibecode applies `limit` and `offset` after it receives the full list from Bitrix24. If the preset contains more than 50 fields, pass an explicit `limit` — the default is 50 records.

## See also

- [Get a preset field](/docs/entities/requisite-presets/preset-fields/get)
- [Add a field to a preset](/docs/entities/requisite-presets/preset-fields/create)
- [Fields available to add](/docs/entities/requisite-presets/preset-fields/available)
- [Get preset](/docs/entities/requisite-presets/get)
- [List requisite presets](/docs/entities/requisite-presets/list)
