Set brand rules in one go
curl --request PATCH \
--url http://localhost:3000/api/v1/brand/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"set": [
{
"key": "<string>",
"type": "color",
"value": "<string>",
"label": "<string>",
"context": "<string>",
"usage": "<string>",
"assets": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"spec": {
"token": "<string>",
"group": "<string>",
"weight": 50,
"pair": "<string>",
"tints": [
50
],
"cmyk": [
50,
50,
50,
50
],
"pantone": [
"<string>"
],
"ral": "<string>",
"rgb": [
127,
127,
127
],
"texture": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
],
"remove": [
{
"key": "<string>",
"context": "<string>"
}
]
}
'import requests
url = "http://localhost:3000/api/v1/brand/rules"
payload = {
"set": [
{
"key": "<string>",
"type": "color",
"value": "<string>",
"label": "<string>",
"context": "<string>",
"usage": "<string>",
"assets": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"spec": {
"token": "<string>",
"group": "<string>",
"weight": 50,
"pair": "<string>",
"tints": [50],
"cmyk": [50, 50, 50, 50],
"pantone": ["<string>"],
"ral": "<string>",
"rgb": [127, 127, 127],
"texture": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
],
"remove": [
{
"key": "<string>",
"context": "<string>"
}
]
}
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({
set: [
{
key: '<string>',
type: 'color',
value: '<string>',
label: '<string>',
context: '<string>',
usage: '<string>',
assets: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
spec: {
token: '<string>',
group: '<string>',
weight: 50,
pair: '<string>',
tints: [50],
cmyk: [50, 50, 50, 50],
pantone: ['<string>'],
ral: '<string>',
rgb: [127, 127, 127],
texture: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
}
],
remove: [{key: '<string>', context: '<string>'}]
})
};
fetch('http://localhost:3000/api/v1/brand/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/brand/rules",
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([
'set' => [
[
'key' => '<string>',
'type' => 'color',
'value' => '<string>',
'label' => '<string>',
'context' => '<string>',
'usage' => '<string>',
'assets' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'spec' => [
'token' => '<string>',
'group' => '<string>',
'weight' => 50,
'pair' => '<string>',
'tints' => [
50
],
'cmyk' => [
50,
50,
50,
50
],
'pantone' => [
'<string>'
],
'ral' => '<string>',
'rgb' => [
127,
127,
127
],
'texture' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'remove' => [
[
'key' => '<string>',
'context' => '<string>'
]
]
]),
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 := "http://localhost:3000/api/v1/brand/rules"
payload := strings.NewReader("{\n \"set\": [\n {\n \"key\": \"<string>\",\n \"type\": \"color\",\n \"value\": \"<string>\",\n \"label\": \"<string>\",\n \"context\": \"<string>\",\n \"usage\": \"<string>\",\n \"assets\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"spec\": {\n \"token\": \"<string>\",\n \"group\": \"<string>\",\n \"weight\": 50,\n \"pair\": \"<string>\",\n \"tints\": [\n 50\n ],\n \"cmyk\": [\n 50,\n 50,\n 50,\n 50\n ],\n \"pantone\": [\n \"<string>\"\n ],\n \"ral\": \"<string>\",\n \"rgb\": [\n 127,\n 127,\n 127\n ],\n \"texture\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n ],\n \"remove\": [\n {\n \"key\": \"<string>\",\n \"context\": \"<string>\"\n }\n ]\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("http://localhost:3000/api/v1/brand/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"set\": [\n {\n \"key\": \"<string>\",\n \"type\": \"color\",\n \"value\": \"<string>\",\n \"label\": \"<string>\",\n \"context\": \"<string>\",\n \"usage\": \"<string>\",\n \"assets\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"spec\": {\n \"token\": \"<string>\",\n \"group\": \"<string>\",\n \"weight\": 50,\n \"pair\": \"<string>\",\n \"tints\": [\n 50\n ],\n \"cmyk\": [\n 50,\n 50,\n 50,\n 50\n ],\n \"pantone\": [\n \"<string>\"\n ],\n \"ral\": \"<string>\",\n \"rgb\": [\n 127,\n 127,\n 127\n ],\n \"texture\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n ],\n \"remove\": [\n {\n \"key\": \"<string>\",\n \"context\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/brand/rules")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"set\": [\n {\n \"key\": \"<string>\",\n \"type\": \"color\",\n \"value\": \"<string>\",\n \"label\": \"<string>\",\n \"context\": \"<string>\",\n \"usage\": \"<string>\",\n \"assets\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"spec\": {\n \"token\": \"<string>\",\n \"group\": \"<string>\",\n \"weight\": 50,\n \"pair\": \"<string>\",\n \"tints\": [\n 50\n ],\n \"cmyk\": [\n 50,\n 50,\n 50,\n 50\n ],\n \"pantone\": [\n \"<string>\"\n ],\n \"ral\": \"<string>\",\n \"rgb\": [\n 127,\n 127,\n 127\n ],\n \"texture\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n ],\n \"remove\": [\n {\n \"key\": \"<string>\",\n \"context\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"brand": "<string>",
"created": [
"<string>"
],
"updated": [
"<string>"
],
"removed": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}API Reference
Set brand rules in one go
The MCP tool set_rules. Each of set is made, or changes the rule with its key and context (its type can’t change: remove it first); each of remove goes, a key without a context with every context version. All or none, checked together, so a gradient and the colors it names can arrive at once: a 422 lists every problem with its path, e.g. set[0].spec: .... One change in the brand’s history.
Scope: write.
PATCH
/
api
/
v1
/
brand
/
rules
Set brand rules in one go
curl --request PATCH \
--url http://localhost:3000/api/v1/brand/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"set": [
{
"key": "<string>",
"type": "color",
"value": "<string>",
"label": "<string>",
"context": "<string>",
"usage": "<string>",
"assets": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"spec": {
"token": "<string>",
"group": "<string>",
"weight": 50,
"pair": "<string>",
"tints": [
50
],
"cmyk": [
50,
50,
50,
50
],
"pantone": [
"<string>"
],
"ral": "<string>",
"rgb": [
127,
127,
127
],
"texture": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
],
"remove": [
{
"key": "<string>",
"context": "<string>"
}
]
}
'import requests
url = "http://localhost:3000/api/v1/brand/rules"
payload = {
"set": [
{
"key": "<string>",
"type": "color",
"value": "<string>",
"label": "<string>",
"context": "<string>",
"usage": "<string>",
"assets": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"spec": {
"token": "<string>",
"group": "<string>",
"weight": 50,
"pair": "<string>",
"tints": [50],
"cmyk": [50, 50, 50, 50],
"pantone": ["<string>"],
"ral": "<string>",
"rgb": [127, 127, 127],
"texture": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
],
"remove": [
{
"key": "<string>",
"context": "<string>"
}
]
}
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({
set: [
{
key: '<string>',
type: 'color',
value: '<string>',
label: '<string>',
context: '<string>',
usage: '<string>',
assets: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
spec: {
token: '<string>',
group: '<string>',
weight: 50,
pair: '<string>',
tints: [50],
cmyk: [50, 50, 50, 50],
pantone: ['<string>'],
ral: '<string>',
rgb: [127, 127, 127],
texture: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
}
],
remove: [{key: '<string>', context: '<string>'}]
})
};
fetch('http://localhost:3000/api/v1/brand/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/brand/rules",
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([
'set' => [
[
'key' => '<string>',
'type' => 'color',
'value' => '<string>',
'label' => '<string>',
'context' => '<string>',
'usage' => '<string>',
'assets' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'spec' => [
'token' => '<string>',
'group' => '<string>',
'weight' => 50,
'pair' => '<string>',
'tints' => [
50
],
'cmyk' => [
50,
50,
50,
50
],
'pantone' => [
'<string>'
],
'ral' => '<string>',
'rgb' => [
127,
127,
127
],
'texture' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'remove' => [
[
'key' => '<string>',
'context' => '<string>'
]
]
]),
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 := "http://localhost:3000/api/v1/brand/rules"
payload := strings.NewReader("{\n \"set\": [\n {\n \"key\": \"<string>\",\n \"type\": \"color\",\n \"value\": \"<string>\",\n \"label\": \"<string>\",\n \"context\": \"<string>\",\n \"usage\": \"<string>\",\n \"assets\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"spec\": {\n \"token\": \"<string>\",\n \"group\": \"<string>\",\n \"weight\": 50,\n \"pair\": \"<string>\",\n \"tints\": [\n 50\n ],\n \"cmyk\": [\n 50,\n 50,\n 50,\n 50\n ],\n \"pantone\": [\n \"<string>\"\n ],\n \"ral\": \"<string>\",\n \"rgb\": [\n 127,\n 127,\n 127\n ],\n \"texture\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n ],\n \"remove\": [\n {\n \"key\": \"<string>\",\n \"context\": \"<string>\"\n }\n ]\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("http://localhost:3000/api/v1/brand/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"set\": [\n {\n \"key\": \"<string>\",\n \"type\": \"color\",\n \"value\": \"<string>\",\n \"label\": \"<string>\",\n \"context\": \"<string>\",\n \"usage\": \"<string>\",\n \"assets\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"spec\": {\n \"token\": \"<string>\",\n \"group\": \"<string>\",\n \"weight\": 50,\n \"pair\": \"<string>\",\n \"tints\": [\n 50\n ],\n \"cmyk\": [\n 50,\n 50,\n 50,\n 50\n ],\n \"pantone\": [\n \"<string>\"\n ],\n \"ral\": \"<string>\",\n \"rgb\": [\n 127,\n 127,\n 127\n ],\n \"texture\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n ],\n \"remove\": [\n {\n \"key\": \"<string>\",\n \"context\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/brand/rules")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"set\": [\n {\n \"key\": \"<string>\",\n \"type\": \"color\",\n \"value\": \"<string>\",\n \"label\": \"<string>\",\n \"context\": \"<string>\",\n \"usage\": \"<string>\",\n \"assets\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"spec\": {\n \"token\": \"<string>\",\n \"group\": \"<string>\",\n \"weight\": 50,\n \"pair\": \"<string>\",\n \"tints\": [\n 50\n ],\n \"cmyk\": [\n 50,\n 50,\n 50,\n 50\n ],\n \"pantone\": [\n \"<string>\"\n ],\n \"ral\": \"<string>\",\n \"rgb\": [\n 127,\n 127,\n 127\n ],\n \"texture\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n ],\n \"remove\": [\n {\n \"key\": \"<string>\",\n \"context\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"brand": "<string>",
"created": [
"<string>"
],
"updated": [
"<string>"
],
"removed": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}Authorizations
bearersession
An API key: ab_...
Query Parameters
A brand's slug; the default brand when left out
Body
application/json
Response
What changed, each as key (context)
Show child attributes
Show child attributes