Add a brand color
Adds a color to the editor's brand kit, which every user of the editor gets.
curl https://api.muzekit.com/v1/brand/colors \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "value": "#3B6EF5", "name": "Primary" }'const res = await fetch("https://api.muzekit.com/v1/brand/colors", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ value: "#3B6EF5", name: "Primary" }),
});
const color = await res.json();import os
import requests
color = requests.post(
"https://api.muzekit.com/v1/brand/colors",
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
json={"value": "#3B6EF5", "name": "Primary"},
).json()Body
valuestringrequiredA six-digit hex color, like #3B6EF5. Stored in upper case.
namestringA label shown in the editor, up to 60 characters.
The brand kit is the editor's, so Test and Live keys add to the same one. A value that isn't a hex color is refused with 400 invalid_color. Images and fonts go in with Upload an asset and "brand": true; see the whole kit with Get the brand kit.
Examples
Add your palette
One request adds one color, so loop over the palette. The same value sent twice gives two entries; see Add only the colors that are missing.
for PAIR in "#3B6EF5:Primary" "#E8553D:Coral" "#111827:Ink"; do
curl -s https://api.muzekit.com/v1/brand/colors \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "{ \"value\": \"${PAIR%%:*}\", \"name\": \"${PAIR#*:}\" }"
doneconst palette = [
{ value: "#3B6EF5", name: "Primary" },
{ value: "#E8553D", name: "Coral" },
{ value: "#111827", name: "Ink" },
];
for (const color of palette) {
await fetch("https://api.muzekit.com/v1/brand/colors", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(color),
});
}import os
import requests
palette = [
{"value": "#3B6EF5", "name": "Primary"},
{"value": "#E8553D", "name": "Coral"},
{"value": "#111827", "name": "Ink"},
]
for color in palette:
requests.post(
"https://api.muzekit.com/v1/brand/colors",
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
json=color,
)Set up a brand kit for a new editor
A full kit is colors, a logo and a font. Colors go in here; the logo and the font are uploads with "brand": true (the font with its family). Every end user gets them in their next session.
AUTH="Authorization: Bearer $MUZEKIT_SECRET_KEY"
API=https://api.muzekit.com/v1
# Colors
curl -s $API/brand/colors -H "$AUTH" -H "Content-Type: application/json" \
-d '{ "value": "#3B6EF5", "name": "Primary" }'
# Logo
URL=$(curl -s $API/assets/uploads -H "$AUTH" -H "Content-Type: application/json" \
-d '{ "name": "logo.png", "type": "image/png", "brand": true }' \
| jq -r .upload_url)
curl -X PUT "$URL" -H "Content-Type: image/png" --data-binary @logo.png
# Font
URL=$(curl -s $API/assets/uploads -H "$AUTH" -H "Content-Type: application/json" \
-d '{
"name": "Acme-Bold.woff2",
"type": "font/woff2",
"family": "Acme",
"brand": true
}' \
| jq -r .upload_url)
curl -X PUT "$URL" -H "Content-Type: font/woff2" --data-binary @Acme-Bold.woff2import { readFile } from "node:fs/promises";
const API = "https://api.muzekit.com/v1";
const headers = {
Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}`,
"Content-Type": "application/json",
};
async function uploadBrandFile(path, type, extra = {}) {
const res = await fetch(`${API}/assets/uploads`, {
method: "POST",
headers,
body: JSON.stringify({ name: path, type, brand: true, ...extra }),
});
const upload = await res.json();
await fetch(upload.upload_url, {
method: "PUT",
headers: { "Content-Type": type },
body: await readFile(path),
});
}
await fetch(`${API}/brand/colors`, {
method: "POST",
headers,
body: JSON.stringify({ value: "#3B6EF5", name: "Primary" }),
});
await uploadBrandFile("logo.png", "image/png");
await uploadBrandFile("Acme-Bold.woff2", "font/woff2", { family: "Acme" });import os
import requests
API = "https://api.muzekit.com/v1"
headers = {"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"}
def upload_brand_file(path, mime, **extra):
upload = requests.post(
f"{API}/assets/uploads",
headers=headers,
json={"name": path, "type": mime, "brand": True, **extra},
).json()
with open(path, "rb") as f:
requests.put(upload["upload_url"], headers={"Content-Type": mime}, data=f)
requests.post(
f"{API}/brand/colors",
headers=headers,
json={"value": "#3B6EF5", "name": "Primary"},
)
upload_brand_file("logo.png", "image/png")
upload_brand_file("Acme-Bold.woff2", "font/woff2", family="Acme")Response
{
"object": "asset",
"id": "ast_dQC3Z8RgqAH",
"kind": "color",
"name": "Primary",
"url": null,
"value": "#3B6EF5",
"type": null,
"size": null,
"width": null,
"height": null,
"family": null,
"created_at": "2026-10-17T02:10:00.000Z"
}