---
title: "Update/create an attribute option"
method: PATCH
path: "/api/rest/v1/attributes/{attribute_code}/options/{code}"
tags: ["Attribute option"]
---

# Update/create an attribute option

`PATCH /api/rest/v1/attributes/{attribute_code}/options/{code}`

## Request

- Base URL: `http://demo.akeneo.com`
- URL: `http://demo.akeneo.com/api/rest/v1/attributes/{attribute_code}/options/{code}`
- Auth: none declared

This endpoint allows you to update a given attribute option. Know more about <a href="/documentation/update.html#update-behavior">Update behavior</a>. Note that if no attribute option exists for the given code, it creates it. Please note that this endpoint applies a rate limit of 3 concurrent API requests per second.

## Path parameters

- `attribute_code` string, required
- `code` string, required

## Request body

- object
  - `code` string, required: Code of option
  - `attribute` string: Code of attribute related to the attribute option
  - `sort_order` integer: Order of attribute option
  - `labels` object: Attribute option labels for each locale
    - `localeCode` string: Attribute option label for the locale `localeCode`

## Response `201`

Created

## Other responses

- `204`: No content to return
- `400`: Bad request
- `401`: Authentication required
- `403`: Access forbidden
- `415`: Unsupported Media type
- `422`: Unprocessable entity
- `429`: Too many requests

---

[API](https://skmtc.dev/akeneo/apis/akeneo-pim-rest-api.md) - [All operations](https://skmtc.dev/akeneo/apis/akeneo-pim-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/akeneo/apis/akeneo-pim-rest-api/revisions/d8bda9b93b59?raw)
