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"}]namestringrequiredDer Name der Marke.
descriptionstringEin Satz, höchstens 500 Zeichen. Die ausführliche Beschreibung gehört in identity.longDescription.
logosarray{ name, content } oder { path }, mit optionaler role (primary, secondary, icon, monogram, other) und main. Höchstens 12, je 5 MB; SVG, PNG, JPEG oder WebP, erkannt an den Bytes, nie am Namen.
palettearray | objectEine Farbliste ("#6B3E26" oder { hex, role, name }) oder { colors, typography }. Ohne sie werden die Farben aus dem Hauptlogo gewonnen.
identityobjectSlogan, ausführliche Beschreibung, Branche, Sprachen, Gründungsjahr, Domain, soziale Netzwerke.
platformobjectMission, Vision, Werte, Positionierung, Versprechen, Zielgruppen, Archetyp, Tonalität, Botschaften.
assetsarrayFotos, Videos oder Illustrationen — siehe assets.
Eine abgelehnte Ressource bricht die Marke nicht ab
Zuerst wird die Marke angelegt, dann ihre Ressourcen. Eine fehlgeschlagene steht in brand.assetErrors — mit Index, Code und Meldung —, die übrigen bleiben erhalten.
Fehler
| Code | Status | Wann |
|---|---|---|
| invalid_name | 400 | Kein Name oder ein leerer Name. |
| invalid_field | 400 | Ein unbekanntes Feld von identity oder platform oder ein Wert vom falschen Typ. |
| unsupported_logo | 400 | Die Bytes sind kein SVG-, PNG-, JPEG- oder WebP-Bild. |
| unsafe_svg | 400 | Das SVG enthält ein Skript, einen Event-Handler, eingebettetes HTML oder einen externen Link. |
| too_many_logos | 400 | Mehr als 12 Logos. |
| logo_too_large | 413 | Ein Logo über 5 MB. |
| invalid_color | 400 | Eine Farbe, die kein Hex-Wert ist, oder eine unbekannte Rolle. |
| too_many_brands | 403 | Das Konto hat bereits 50 Marken. |