Update Attribute Values
Update existing attribute values for an attribute. This endpoint allows you to modify descriptions, properties, and settings for multiple attribute values in a single request.
PUT /product/v1/attributes/{attributeId}/values
Request Format
The request body must be a JSON array containing updated attribute value objects. Only existing values can be updated.
[
{
"id": "red",
"description": "Premium red color - updated description",
"properties": {
"hexCode": "#CC0000",
"pantone": "PANTONE 18-1664 TPX",
"displayOrder": "2"
},
"isCustom": false,
"isDefault": true
},
{
"id": "blue",
"description": "Premium blue color - updated description",
"properties": {
"hexCode": "#0000CC",
"pantone": "PANTONE 19-4052 TPX",
"displayOrder": "3"
},
"isCustom": false,
"isDefault": false
}
]
Example curl request
curl --location --request PUT 'https://connect.gelatoapis.com/product/v1/attributes/attr-color/values' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '[
{
"id": "red",
"description": "Premium red color - updated description",
"properties": {
"hexCode": "#CC0000",
"pantone": "PANTONE 18-1664 TPX",
"displayOrder": "2"
},
"isCustom": false,
"isDefault": true
},
{
"id": "blue",
"description": "Premium blue color - updated description",
"properties": {
"hexCode": "#0000CC",
"pantone": "PANTONE 19-4052 TPX",
"displayOrder": "3"
},
"isCustom": false,
"isDefault": false
}
]'
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| attributeId | string | Required | Unique identifier of the attribute (URL path parameter) |
| id | string | Required | Existing attribute value ID to update. Must match an existing value. |
| description | string | Optional | Updated human-readable description |
| properties | object | Optional | Updated metadata. Completely replaces existing properties. |
| isCustom | boolean | Optional | Updated custom value flag |
| isDefault | boolean | Optional | Updated default value flag |
Response Format
Returns the updated attribute values with server-generated fields and computed properties:
[
{
"id": "red",
"attributeId": "attr-color",
"description": "Premium red color - updated description",
"properties": {
"hexCode": "#CC0000",
"rgb": "204,0,0",
"pantone": "PANTONE 18-1664 TPX",
"displayOrder": "2"
},
"isCustom": false,
"isDefault": true,
"createdAt": "2024-01-10T09:15:30Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": "blue",
"attributeId": "attr-color",
"description": "Premium blue color - updated description",
"properties": {
"hexCode": "#0000CC",
"rgb": "0,0,204",
"pantone": "PANTONE 19-4052 TPX",
"displayOrder": "3"
},
"isCustom": false,
"isDefault": false,
"createdAt": "2024-01-08T14:20:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
]
Common Use Cases
Update Material Properties:
curl --location --request PUT 'https://connect.gelatoapis.com/product/v1/attributes/attr-material/values' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '[
{
"id": "cotton",
"description": "Premium cotton material - enhanced quality",
"properties": {
"composition": "100% organic cotton",
"weight": "180gsm",
"origin": "certified sustainable sources",
"certifications": ["GOTS", "OEKO-TEX", "BCI"]
},
"isCustom": false,
"isDefault": true
}
]'
Update Size Dimensions:
curl --location --request PUT 'https://connect.gelatoapis.com/product/v1/attributes/attr-size/values' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '[
{
"id": "medium",
"description": "Medium - 15cm x 20cm (updated)",
"properties": {
"dimensions": "15x20cm",
"width": "15",
"height": "20",
"sortOrder": 2,
"printArea": "13x18cm"
},
"isDefault": true
}
]'