const brand = await api.brand.create({
name: "Qahwa Lab",
description: "Specialty coffee roasted in Tunis",
logos: [
{ name: "logo.svg", content: svgText, main: true }, // SVG text, bytes, a Blob or base64
{ path: "./icon.png", role: "icon" }, // Node.js only
],
palette: ["#6B3E26", "#D9A441"], // optional
identity: { tagline: "Roasted every morning" },
assets: [{ cloud: "Brand/storefront.jpg", role: "hero" }],
});brand = api.brand.create(
name="Qahwa Lab",
description="Specialty coffee roasted in Tunis",
logos=[
{"name": "logo.svg", "content": svg_text, "main": True}, # SVG text, bytes or base64
{"path": "icon.png", "role": "icon"},
],
palette=["#6B3E26", "#D9A441"], # optional
identity={"tagline": "Roasted every morning"},
assets=[{"cloud": "Brand/storefront.jpg", "role": "hero"}],
)
brand.asset_errors # None, or [{"index", "code", "message"}]namestringrequiredThe brand's name.
descriptionstringOne sentence, 500 characters at most. The long description belongs in identity.longDescription.
logosarray{ name, content } or { path }, with an optional role (primary, secondary, icon, monogram, other) and main. 12 at most, 5 MB each; SVG, PNG, JPEG or WebP, read from the bytes, never from the name.
palettearray | objectA list of colors ("#6B3E26" or { hex, role, name }), or { colors, typography }. Without it, colors are extracted from the main logo.
identityobjectTagline, long description, sector, languages, founding year, domain, socials.
platformobjectMission, vision, values, positioning, promise, audiences, archetype, voice, messages.
assetsarrayPhotos, videos or illustrations — see assets.
A refused resource does not cancel the brand
The brand is created first, then its resources. One that fails is listed in brand.assetErrors — its index, code and message — and the others are kept.
Errors
| Code | Status | When |
|---|---|---|
| invalid_name | 400 | No name, or an empty one. |
| invalid_field | 400 | An unknown field of identity or platform, or a value of the wrong type. |
| unsupported_logo | 400 | The bytes are not an SVG, PNG, JPEG or WebP image. |
| unsafe_svg | 400 | The SVG carries a script, an event handler, embedded HTML or an external link. |
| too_many_logos | 400 | More than 12 logos. |
| logo_too_large | 413 | A logo above 5 MB. |
| invalid_color | 400 | A color that is not a hex value, or an unknown role. |
| too_many_brands | 403 | The account already has 50 brands. |