curl --request PATCH \
--url https://www.merchkit.com/api/v1/attributes/{key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_type": "product"
}
'import requests
url = "https://www.merchkit.com/api/v1/attributes/{key}"
payload = { "entity_type": "product" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({entity_type: 'product'})
};
fetch('https://www.merchkit.com/api/v1/attributes/{key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.merchkit.com/api/v1/attributes/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'entity_type' => 'product'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.merchkit.com/api/v1/attributes/{key}"
payload := strings.NewReader("{\n \"entity_type\": \"product\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://www.merchkit.com/api/v1/attributes/{key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_type\": \"product\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/attributes/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_type\": \"product\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "a3d81c22-5f6e-4b09-8d17-c40a92e5b613",
"name": "Material",
"key": "material",
"data_type": "single_select_list",
"tool": "manual",
"entity_type": "product",
"channel": null,
"is_primary": false,
"custom_instructions": null,
"acceptable_values": "White Oak,Smoked Oak,Walnut",
"default_value": null,
"constraints": {},
"source_attributes": null
}
}{
"error": {
"code": "validation_failed",
"message": "Unknown attribute key(s): colour.",
"documentation_url": "https://docs.merchkit.com/developers/errors#validation_failed",
"is_retriable": false,
"retry_after_seconds": null,
"alternative_action": "List valid attribute keys via GET /v1/attributes?type=product.",
"request_id": "req_01j9x2k8",
"field_errors": [
{
"field": "colour",
"issue": "not_a_defined_attribute"
}
]
}
}Update an attribute definition
Identified by the path key + entity_type in the body. Provide only the fields to change; array fields replace wholesale.
Scope: write:attributes.
curl --request PATCH \
--url https://www.merchkit.com/api/v1/attributes/{key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_type": "product"
}
'import requests
url = "https://www.merchkit.com/api/v1/attributes/{key}"
payload = { "entity_type": "product" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({entity_type: 'product'})
};
fetch('https://www.merchkit.com/api/v1/attributes/{key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.merchkit.com/api/v1/attributes/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'entity_type' => 'product'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.merchkit.com/api/v1/attributes/{key}"
payload := strings.NewReader("{\n \"entity_type\": \"product\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://www.merchkit.com/api/v1/attributes/{key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_type\": \"product\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/attributes/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_type\": \"product\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "a3d81c22-5f6e-4b09-8d17-c40a92e5b613",
"name": "Material",
"key": "material",
"data_type": "single_select_list",
"tool": "manual",
"entity_type": "product",
"channel": null,
"is_primary": false,
"custom_instructions": null,
"acceptable_values": "White Oak,Smoked Oak,Walnut",
"default_value": null,
"constraints": {},
"source_attributes": null
}
}{
"error": {
"code": "validation_failed",
"message": "Unknown attribute key(s): colour.",
"documentation_url": "https://docs.merchkit.com/developers/errors#validation_failed",
"is_retriable": false,
"retry_after_seconds": null,
"alternative_action": "List valid attribute keys via GET /v1/attributes?type=product.",
"request_id": "req_01j9x2k8",
"field_errors": [
{
"field": "colour",
"issue": "not_a_defined_attribute"
}
]
}
}Authorizations
Workspace-scoped API key (mk_live_...). Each operation lists the scope it requires in x-required-scopes. See the Authentication guide for the full scope table and key management.
Path Parameters
The attribute key.
Body
Update body — the attribute is identified by the path key + entity_type. Only provided fields change; array fields replace wholesale. Accepts the same config fields as create (all optional except entity_type).
single_line_text_field, multi_line_text_field, rich_text_field, number, boolean, date, url, json, single_select_list, multi_select_list, image, video, formula, status, progress, rank includeDataSources, includeImages, includeWebSearch, includeProductAttributes gpt-image-1, nano-banana Square, Landscape, Portrait veo3.1 off, inherit_from_parent, rollup_from_children unique, all Response
The updated attribute definition (full config).
The full attribute-definition config returned by create/update — a superset of the discovery projection (raw acceptable_values string, generation tool, constraints).
Show child attributes
Show child attributes
{
"id": "a3d81c22-5f6e-4b09-8d17-c40a92e5b613",
"name": "Material",
"key": "material",
"data_type": "single_select_list",
"tool": "manual",
"entity_type": "product",
"channel": null,
"is_primary": false,
"custom_instructions": null,
"acceptable_values": "White Oak,Smoked Oak,Walnut",
"default_value": null,
"constraints": {},
"source_attributes": null
}
Was this page helpful?