cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 - update product attribute option label and or position

Magento 2 - update product attribute option label and or position

Hello,

 

How would I go about updating programmatically a product attribute option, per example
I tried using the PUT method on products/attributes but that always gives me a new option, so I like to be able to update an existing attribute options label and position, anyone who can point me in the right direction? 

I googled a lot but can't seem to find examples that'll help me... 

Thanks in advance

{
  "attribute_id": 164,
  "attribute_code": "164",
  "frontend_input": "select",
  "entity_type_id": "4",
  "is_required": true,
  "options": [
    {
      "label": "Blue",  <!-- change label
      "value": "217"
    },
    {
      "label": "Green",  <!-- change label
      "value": "216"
    }
}