
## Update a preset field

`PATCH /v1/requisite-presets/:presetId/fields/:id`

Updates the title, sort position, or short-list flag of a preset field row. Pass only the fields you want to change.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `presetId` (path) | number | yes | Requisite preset ID |
| `id` (path) | number | yes | Preset field row ID (from [`GET /v1/requisite-presets/:presetId/fields`](/docs/entities/requisite-presets/preset-fields/list) — the `id` field) |

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `fieldTitle` | string | no | Field title in the Bitrix24 interface |
| `inShortList` | boolean | no | Whether to show the field in the short list. Accepts `true`/`false` |
| `sort` | number | no | Sort order of the field within the preset |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/requisite-presets/1/fields/1" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fieldTitle": "Company tax ID",
    "inShortList": false,
    "sort": 100
  }'
```

### curl — OAuth app

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/requisite-presets/1/fields/1" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sort": 100
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/requisite-presets/1/fields/1', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fieldTitle: 'Company tax ID',
    inShortList: false,
    sort: 100,
  }),
})

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

### JavaScript — OAuth app

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/requisite-presets/1/fields/1', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    sort: 100,
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | Operation result |
| `data.id` | number | ID of the updated preset field row |
| `data.updated` | boolean | Always `true` on successful update |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 1,
    "updated": true
  }
}
```

## Error response example

404 — field row not found:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | No field row with this `id` found in the given preset |
| 400 | `INVALID_PRESET_ID` | `presetId` is not a positive integer |
| 400 | `INVALID_FIELD_ID` | `id` is not a positive integer |
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope. Message: `This endpoint requires 'crm' scope` |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

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

## Known specifics

**`fieldName` cannot be changed.** The system field name is set when the field is added and does not change. To replace a field, delete the row and add a new one with the desired `fieldName`.

**Re-read the list before updating.** A field row `id` is positional and may change after the preset composition changes. Take the current `id` from a fresh [field list](/docs/entities/requisite-presets/preset-fields/list), finding the row by `fieldName` — otherwise the update may hit a different field.

## See also

- [List preset fields](/docs/entities/requisite-presets/preset-fields/list)
- [Add a field to a preset](/docs/entities/requisite-presets/preset-fields/create)
- [Delete a preset field](/docs/entities/requisite-presets/preset-fields/delete)
- [Requisite presets](/docs/entities/requisite-presets)
