## Update a list-property value

`PATCH /v1/catalog-product-property-enums/:id`

Updates individual fields of a catalog list-property option. Send the fields at the root of the JSON, with no wrapper.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Value identifier from the [list of values](/docs/entities/catalog-product-property-enums/list) |

## Request fields (body)

Send at least one editable field.

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `propertyId` | number | no | Identifier of the property from the [list of catalog product properties](/docs/entities/catalog-product-properties/list). The property must have `propertyType: "L"` |
| `value` | string | no | New option text |
| `xmlId` | string | no | External code for imports and integrations |
| `sort` | number | no | Sort order within the property |
| `def` | boolean | no | Make the option the default value of the property |
| `id` | number | no | RO. The identifier cannot be changed |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/catalog-product-property-enums/1769" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":"Additional option 2"}'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/catalog-product-property-enums/1769" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":"Additional option 2"}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-product-property-enums/1769', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    value: 'Additional option 2',
  }),
})

const { data } = await res.json()
console.log(data.id)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-product-property-enums/1769', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    value: 'Additional option 2',
  }),
})

const { data } = await res.json()
console.log(data.id)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on a successful request |
| `data` | object | List-property value |
| `data.id` | number | Identifier of the value |
| `data.propertyId` | number | Identifier of the owning property |
| `data.value` | string | Option text |
| `data.def` | boolean | Whether the option is the default value of the property |
| `data.sort` | number | Sort order within the property |
| `data.xmlId` | string \| null | External code. `null` when the code is not set |
| `meta` | object | Optional additional details |
| `meta.warnings` | object[] | Warnings about the request fields, if there are any |
| `meta.warnings[].code` | string | Warning code |
| `meta.warnings[].message` | string | Explanation of the warning |
| `meta.warnings[].field` | string | Field the warning refers to |

## Response example

200 — the option is updated:

```json
{
  "success": true,
  "data": {
    "def": false,
    "id": 1769,
    "propertyId": 295,
    "sort": 100,
    "value": "Additional option 2",
    "xmlId": "EXTRA-20261013"
  }
}
```

## Error response example

404 — the value has been deleted and the request included `propertyId` and `xmlId`:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "productPropertyEnum does not exist."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | Invalid type or shape of a request field or of `id` in the path |
| 400 | `EMPTY_UPDATE_BODY` | The request body is empty |
| 400 | `READONLY_FIELD` | The body carries `id`, which is read-only |
| 404 | `ENTITY_NOT_FOUND` | There is no value with the given identifier |
| 422 | `BITRIX_ERROR` | Bitrix24 refusal. For a deleted value sent without `propertyId` or `xmlId`, the message `Required fields` arrives with the list of missing fields |
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key allows reading only |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not sent |

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

## Known specifics

**Field substitution.** On a single update the API reads the current record and fills in `propertyId` and `xmlId` when they are not sent. Explicitly sent values take precedence.

There is no substitution in [batch requests](/docs/batch). In every update through `POST /v1/batch` or `POST /v1/catalog-product-property-enums/batch`, send `propertyId` and `xmlId` explicitly. Otherwise the operation is rejected before Bitrix24 is called.

## See also

- [List values](/docs/entities/catalog-product-property-enums/list)
- [Get a value](/docs/entities/catalog-product-property-enums/get)
- [Value fields](/docs/entities/catalog-product-property-enums/fields)
- [List properties](/docs/entities/catalog-product-properties/list)
- [Create a list-property value](/docs/entities/catalog-product-property-enums/create)
- [Delete a list-property value](/docs/entities/catalog-product-property-enums/delete)
- [Batch](/docs/batch)
