curl --request POST \
--url https://www.merchkit.com/api/v1/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"ai_generated": false
}
'import requests
url = "https://www.merchkit.com/api/v1/attributes"
payload = {
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"ai_generated": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Material',
entity_type: 'product',
data_type: 'single_select_list',
ai_generated: false
})
};
fetch('https://www.merchkit.com/api/v1/attributes', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Material',
'entity_type' => 'product',
'data_type' => 'single_select_list',
'ai_generated' => false
]),
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"
payload := strings.NewReader("{\n \"name\": \"Material\",\n \"entity_type\": \"product\",\n \"data_type\": \"single_select_list\",\n \"ai_generated\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.merchkit.com/api/v1/attributes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Material\",\n \"entity_type\": \"product\",\n \"data_type\": \"single_select_list\",\n \"ai_generated\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Material\",\n \"entity_type\": \"product\",\n \"data_type\": \"single_select_list\",\n \"ai_generated\": false\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"
}
]
}
}Create an attribute definition
Create an attribute, including full AI-generation config (snake_case body). For an AI-generated attribute set ai_generated: true + custom_instructions (reference other attributes with {{key}}), and pick selected_tools: includeWebSearch (live web research), includeDataSources (scraped sites/CSVs), includeImages (vision), includeProductAttributes. Image/video generation models are supported. inheritance_mode shares a value across a variant family (products only).
Scope: write:attributes.
curl --request POST \
--url https://www.merchkit.com/api/v1/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"ai_generated": false
}
'import requests
url = "https://www.merchkit.com/api/v1/attributes"
payload = {
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"ai_generated": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Material',
entity_type: 'product',
data_type: 'single_select_list',
ai_generated: false
})
};
fetch('https://www.merchkit.com/api/v1/attributes', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Material',
'entity_type' => 'product',
'data_type' => 'single_select_list',
'ai_generated' => false
]),
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"
payload := strings.NewReader("{\n \"name\": \"Material\",\n \"entity_type\": \"product\",\n \"data_type\": \"single_select_list\",\n \"ai_generated\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.merchkit.com/api/v1/attributes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Material\",\n \"entity_type\": \"product\",\n \"data_type\": \"single_select_list\",\n \"ai_generated\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Material\",\n \"entity_type\": \"product\",\n \"data_type\": \"single_select_list\",\n \"ai_generated\": false\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.
Body
Create body (snake_case, like every write body). single_select_list/multi_select_list require acceptable_values.
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 Generation prompt; reference other attributes with {{key}}.
Comma-separated allowed values for select attributes.
AI text-generation tools. includeWebSearch = live web research; includeDataSources = scraped sites/CSVs; includeImages = vision.
includeDataSources, includeImages, includeWebSearch, includeProductAttributes gpt-image-1, nano-banana Square, Landscape, Portrait veo3.1 Parent/child variant inheritance (products only; ignored for image/video attributes). inherit_from_parent = variants display the parent's value; rollup_from_children = the parent displays its variants' combined values; off removes inheritance. Virtualized at read time.
off, inherit_from_parent, rollup_from_children Only with rollup_from_children. unique = distinct values joined; all = one entry per variant. Default unique.
unique, all Response
The created 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?