
## Update a field

`PATCH /v1/lists/:iblockId/fields/:fieldId`

Changes the properties of an existing list field. Pass new values in the `fields` object using the Bitrix24 format.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `iblockId` (path) | string | yes | List ID or symbolic code. Use `ID` or `CODE` from the [List lists](/docs/lists/lists/list) response |
| `fieldId` (path) | string | yes | The `FIELD_ID` value from the [List fields](/docs/lists/fields/list) response. Custom fields use `PROPERTY_<number>`. System fields use a symbolic code, such as `NAME` |

## Request fields (body)

The main settings are the name (`fields.NAME`), whether the field is required (`fields.IS_REQUIRED`), and its position (`fields.SORT`). Pass the current `fields.TYPE` with every update.

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `iblockTypeId` | string | no | Info block type. Values:<br>`lists` — regular lists, the default<br>`lists_socnet` — workgroup lists<br>`bitrix_processes` — service workflows<br>`structure` — company structure type (contains the built-in absence calendar info block `absence`) |
| `socnetGroupId` | number | no | Workgroup ID for lists of type `lists_socnet`. A positive integer from the `id` field returned by [List workgroups](/docs/entities/workgroups/list) |
| `fields` | object | yes | Field properties in Bitrix24 format. Property names are uppercase. Pass `NAME`, the current `TYPE`, and the properties to change |
| `fields.TYPE` | string | yes | Current type from the `TYPE` field returned by [Get a field](/docs/lists/fields/get). Required with every update, but cannot be changed. For code descriptions, see [Field types](/docs/lists/fields/field-types) |
| `fields.NAME` | string | yes | Field name. Pass the current name to leave it unchanged |
| `fields.IS_REQUIRED` | string | no | Whether the field is required: `Y` or `N` |
| `fields.MULTIPLE` | string | no | Whether the field allows multiple values: `Y` or `N` |
| `fields.SORT` | number | no | Field position in the form. To preserve the order, pass the current `SORT` value from [Get a field](/docs/lists/fields/get). Without `SORT`, the field may move to the beginning. Sort values are recalculated in increments of 10 after the update |
| `fields.DEFAULT_VALUE` | string or object | no | Default value. The format depends on `TYPE`: a string for `S`, or an object with `TYPE` and `TEXT` keys for `S:HTML` |
| `fields.CODE` | string | no | Symbolic code of a custom field. Use `FIELD_ID` in the request path, not this code |
| `fields.ROW_COUNT` | number | no | Input height in rows |
| `fields.COL_COUNT` | number | no | Input width in characters |
| `fields.LINK_IBLOCK_ID` | number | no | Linked list ID for reference types `G`, `E`, and `E:...`. Use the `ID` field returned by [List lists](/docs/lists/lists/list) |
| `fields.USER_TYPE_SETTINGS` | object | no | Settings for an extended property type. The available settings depend on `TYPE`. For current settings, see `USER_TYPE_SETTINGS` in [Get a field](/docs/lists/fields/get) |
| `fields.LIST` | object | no | Options for a field of type `L`. Each key is an option ID from `DISPLAY_VALUES_FORM` in [Get a field](/docs/lists/fields/get). Each value is an object with the properties listed below |
| `fields.LIST.<ID>.VALUE` | string | yes | Option text |
| `fields.LIST.<ID>.SORT` | number | no | Option sort order |
| `fields.LIST.<ID>.DEF` | string | no | Whether the option is selected by default: `Y` or `N` |
| `fields.LIST_TEXT_VALUES` | string | no | New options for a field of type `L`, one per line. Use `\n` as the separator. Can be passed together with `LIST` |
| `fields.LIST_DEF` | string[] | no | IDs of default options for a field of type `L`. Use the keys of `DISPLAY_VALUES_FORM` from [Get a field](/docs/lists/fields/get). Include these options in `LIST` as well |
| `fields.SETTINGS` | object | no | Field display settings. To preserve other settings in this object, pass them together with the changed settings |
| `fields.SETTINGS.SHOW_ADD_FORM` | string | no | Show the field when adding an item: `Y` or `N` |
| `fields.SETTINGS.SHOW_EDIT_FORM` | string | no | Show the field when editing an item: `Y` or `N` |
| `fields.SETTINGS.ADD_READ_ONLY_FIELD` | string | no | Make the field read-only when adding an item: `Y` or `N`. Set a default value when using `Y` |
| `fields.SETTINGS.EDIT_READ_ONLY_FIELD` | string | no | Make the field read-only when editing an item: `Y` or `N` |
| `fields.SETTINGS.SHOW_FIELD_PREVIEW` | string | no | Show the field in the item preview: `Y` or `N` |

## Examples

### curl — personal key

```bash
curl -X PATCH https://vibecode.bitrix24.com/v1/lists/23/fields/PROPERTY_1177 \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "NAME": "Current status",
      "TYPE": "S",
      "SORT": 10
    }
  }'
```

### curl — OAuth application

```bash
curl -X PATCH https://vibecode.bitrix24.com/v1/lists/23/fields/PROPERTY_1177 \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "NAME": "Current status",
      "TYPE": "S",
      "SORT": 10
    }
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/lists/23/fields/PROPERTY_1177', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      NAME: 'Current status',
      TYPE: 'S',
      SORT: 10,
    },
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/lists/23/fields/PROPERTY_1177', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      NAME: 'Current status',
      TYPE: 'S',
      SORT: 10,
    },
  }),
})
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | Field update result |
| `data.updated` | boolean | `true` on a successful update |

## Response example

HTTP 200 OK:

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

## Error response example

422 — `TYPE` is missing:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Required parameter \"TYPE\" is missing",
    "b24Code": "ERROR_REQUIRED_PARAMETERS_MISSING"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_IBLOCK_TYPE` | `iblockTypeId` is not one of `lists`, `bitrix_processes`, `lists_socnet`, `structure` |
| 400 | `MISSING_REQUIRED_FIELDS` | The `fields` object is missing |
| 422 | `BITRIX_ERROR` | `NAME` or `TYPE` is missing. The `b24Code` field is `ERROR_REQUIRED_PARAMETERS_MISSING` |
| 422 | `BITRIX_ERROR` | An attempt to change the field type. The `b24Code` field is `ERROR_UPDATE_FIELD` |
| 422 | `BITRIX_ERROR` | No field with the specified `fieldId` was found. The `b24Code` field is `ERROR_UPDATE_FIELD` |
| 403 | `BITRIX_ACCESS_DENIED` | No permission to edit the list |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |
| 403 | `SCOPE_DENIED` | The key lacks the `lists` scope |
| 401 | `TOKEN_MISSING` | The key has no configured tokens |
| 409 | `LISTS_MODULE_NOT_ENABLED` | The Lists module is not enabled on the portal |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

The `fields.ID` value is ignored. The field to update is determined by the `fieldId` parameter in the request path.

## See also

- [Get a field](/docs/lists/fields/get)
- [Create a field](/docs/lists/fields/create)
- [Field types](/docs/lists/fields/field-types)
- [List fields](/docs/lists/fields)
