
## 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 application

```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 application

```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

`data.fields` is an object keyed by field name; each value describes the field: its type, whether it is writable, a label and a description. The set of keys is broken down in the table after the field list. `data.batch` lists the preset operations available in a [batch request](/docs/batch).

| Field | Type | RO | Description |
|------|-----|:--:|---------|
| `id` | number | yes | Preset identifier |
| `entityTypeId` | number | no | 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` | number | no | 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` | string | no | Preset name |
| `active` | boolean | no | Whether the preset is active |
| `sort` | number | no | Sort order |
| `xmlId` | string | no | External identifier for synchronization |
| `createdAt` | datetime | yes | Creation date |
| `updatedAt` | datetime | yes | Last modification date |
| `createdBy` | number | yes | ID of the user who created the preset. List: [`GET /v1/users`](/docs/entities/users) |
| `modifyBy` | number | yes | ID of the user who last modified the preset. List: [`GET /v1/users`](/docs/entities/users) |

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

The `label` and `description` keys in `data.fields.<name>` are returned in English. Request headers do not switch the language.

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.fields.<name>.type` | string | Field type: `number`, `string`, `boolean`, `datetime` |
| `data.fields.<name>.readonly` | boolean | `true` — the field is set by the system and is not accepted on create or update |
| `data.fields.<name>.createOnly` | boolean | `true` — the field is set on create only; in the update body it is rejected with `400 READONLY_FIELD`. The key is present on `entityTypeId` and `countryId` |
| `data.fields.<name>.label` | string | Display name of the field |
| `data.fields.<name>.description` | string | Field explanation |
| `data.batch` | string[] | Preset operations available in a [batch request](/docs/batch): `create`, `update`, `delete` |

## Response example

The `label` and `description` keys are omitted from the example for brevity.

```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 }
    },
    "batch": ["create", "update", "delete"]
  }
}
```

## 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 |
| 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).

## 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)
