
## Requisite preset fields

`GET /v1/requisite-presets/fields`

Returns the schema of requisite preset fields: types and the read-only flag.

## Examples

### curl — personal key

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

### curl — OAuth app

```bash
curl "https://vibecode.bitrix24.com/v1/requisite-presets/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/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 app

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

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

## Response fields

The response is an object `{ success, data: { fields: {...} } }`. Each field is described by an object `{ type, readonly }`.

| Field | Bitrix24 | Type | RO | Description |
|------|-----------|-----|:--:|---------|
| `id` | `ID` | number | yes | Preset identifier |
| `entityTypeId` | `ENTITY_TYPE_ID` | number | | Entity type — always `8`, requisite. Set when the preset is created. Flagged `createOnly` in the schema; sending it in the update body is rejected with `400 READONLY_FIELD` |
| `countryId` | `COUNTRY_ID` | number | | Country identifier for the field set. Set when the preset is created. Flagged `createOnly` in the schema; sending it in the update body is rejected with `400 READONLY_FIELD` |
| `name` | `NAME` | string | | Preset name |
| `active` | `ACTIVE` | boolean | | Whether the preset is active |
| `sort` | `SORT` | number | | Sort order |
| `xmlId` | `XML_ID` | string | | External identifier for synchronization |
| `createdAt` | `DATE_CREATE` | datetime | yes | Creation date |
| `updatedAt` | `DATE_MODIFY` | datetime | yes | Last modification date |
| `createdBy` | `CREATED_BY_ID` | number | yes | Creator identifier |
| `modifyBy` | `MODIFY_BY_ID` | number | yes | Last editor identifier |

`xmlId`, `updatedAt`, `modifyBy` can be `null`. The `createdBy` field equals `0` for system-created presets.

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true },
      "entityTypeId": { "type": "number", "readonly": false, "createOnly": true },
      "countryId": { "type": "number", "readonly": false, "createOnly": true },
      "name": { "type": "string", "readonly": false },
      "active": { "type": "boolean", "readonly": false },
      "sort": { "type": "number", "readonly": false },
      "xmlId": { "type": "string", "readonly": false },
      "createdAt": { "type": "datetime", "readonly": true },
      "updatedAt": { "type": "datetime", "readonly": true },
      "createdBy": { "type": "number", "readonly": true },
      "modifyBy": { "type": "number", "readonly": true }
    }
  }
}
```

## Error response example

403 — missing scope:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 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).

## See also

- [Get preset](/docs/entities/requisite-presets/get)
- [Create preset](/docs/entities/requisite-presets/create)
- [List presets](/docs/entities/requisite-presets/list)
- [Requisite presets](/docs/entities/requisite-presets)
