## Create a list-property value

`POST /v1/catalog-product-property-enums`

Adds a new option to a product catalog list property. Fields go at the root of the JSON, with no wrapper.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `propertyId` | number | yes | Identifier of the list property. Take it from [List properties](/docs/entities/catalog-product-properties/list). The property must have `propertyType: "L"` |
| `value` | string | yes | Option text |
| `xmlId` | string | yes | 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 is assigned on creation and must not be sent |

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-product-property-enums" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"propertyId":295,"value":"Additional option","xmlId":"EXTRA-20261013","sort":100,"def":false}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-product-property-enums" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"propertyId":295,"value":"Additional option","xmlId":"EXTRA-20261013","sort":100,"def":false}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-product-property-enums', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    propertyId: 295,
    value: 'Additional option',
    xmlId: 'EXTRA-20261013',
    sort: 100,
    def: false,
  }),
})

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', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    propertyId: 295,
    value: 'Additional option',
    xmlId: 'EXTRA-20261013',
    sort: 100,
    def: false,
  }),
})

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 extra details |
| `meta.warnings` | object[] | Warnings about request fields, when there are any |
| `meta.warnings[].code` | string | Warning code |
| `meta.warnings[].message` | string | Warning explanation |
| `meta.warnings[].field` | string | Field the warning applies to |

## Response example

201 — the option is created:

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

## Error response example

422 — an option with this external code already exists:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "The record with the \"External code\" value equal to \"EXTRA-20261013\" is already in the database",
    "b24Code": "BX_INVALID_VALUE"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | Invalid type or shape of a request field |
| 400 | `MISSING_REQUIRED_FIELDS` | One of the required fields was not sent: `propertyId`, `value`, `xmlId` |
| 400 | `READONLY_FIELD` | The body carries `id`, which is read-only |
| 422 | `BITRIX_ERROR` | Bitrix24 refusal: a duplicate `xmlId`, a property of another type, or a property outside the product catalog. The reason is in `error.message` |
| 403 | `SCOPE_DENIED` | The API key does not carry 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).

## 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)
- [Update a list-property value](/docs/entities/catalog-product-property-enums/update)
- [Delete a list-property value](/docs/entities/catalog-product-property-enums/delete)
