GET

Get the brand kit

The colors, fonts and images every user of the editor gets.

View as Markdown
GEThttps://api.muzekit.com/v1/brand
curl https://api.muzekit.com/v1/brand \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

Add images and fonts with Upload an asset and "brand": true. Add a color with Add a brand color; remove any item with Remove a brand item.

The brand kit is the editor's, so Test and Live keys see the same one. Items come oldest first.

Examples

Add only the colors that are missing

Adding the same color twice gives two entries. When you sync colors from your own settings, read the kit first and add only new values. Values are stored in upper case, so compare them that way.

HAVE=$(curl -s https://api.muzekit.com/v1/brand \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" | jq -r '.colors[].value')

for HEX in "#3B6EF5" "#E8553D"; do
  if ! grep -qx "$HEX" <<< "$HAVE"; then
    curl -s https://api.muzekit.com/v1/brand/colors \
      -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d "{ \"value\": \"$HEX\" }"
  fi
done

Find a brand item to remove

Look an item up by name (or family for fonts) to get the id that Remove a brand item needs.

curl -s https://api.muzekit.com/v1/brand \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  | jq -r '.images[] | select(.name == "logo.png") | .id'

Response

Each item has every asset field; this example shows the ones that matter for its kind.

JSON
{
  "object": "brand",
  "colors": [
    {
      "object": "asset",
      "id": "ast_…",
      "kind": "color",
      "name": "Coral",
      "tags": ["primary"],
      "value": "#E8553D",
      "url": null
    }
  ],
  "fonts": [
    {
      "object": "asset",
      "id": "ast_…",
      "kind": "font",
      "name": "Acme-Bold.woff2",
      "family": "Acme",
      "url": "https://storage.muzekit.com/…"
    }
  ],
  "images": [
    {
      "object": "asset",
      "id": "ast_…",
      "kind": "image",
      "name": "logo.png",
      "url": "https://storage.muzekit.com/…",
      "width": 512,
      "height": 512
    }
  ]
}