api.brand

create()

api.brand.create({ name, description?, logos?, palette?, identity?, platform?, assets? }) → Promise<Brand>

تنشئ علامة تجارية. الاسم وحده إلزامي، وكل ما عداه يمكن أن يأتي لاحقًا، كتلةً بعد كتلة.

POST /api/brandfreecolors from the logo
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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"}]
namestringrequired

اسم العلامة التجارية.

descriptionstring

جملة واحدة، 500 حرف على الأكثر. أما الوصف المطوّل فمكانه identity.longDescription.

logosarray

{ name, content } أو { path }، مع role اختياري (primary، secondary، icon، monogram، other) وmain. 12 على الأكثر، بحجم 5 ميغابايت لكل منها؛ SVG أو PNG أو JPEG أو WebP، يُتعرَّف عليها من البايتات لا من الاسم.

palettearray | object

قائمة ألوان ("#6B3E26" أو { hex, role, name })، أو { colors, typography }. وبدونها تُستخرج الألوان من الشعار الرئيسي.

identityobject

الشعار النصي، والوصف المطوّل، والقطاع، واللغات، وسنة التأسيس، والنطاق، وحسابات التواصل.

platformobject

المهمة، والرؤية، والقيم، والتموضع، والوعد، والجماهير، والنموذج الأصلي، ونبرة الصوت، والرسائل.

assetsarray

صور أو مقاطع فيديو أو رسوم توضيحية — انظر assets.

المورد المرفوض لا يلغي العلامة التجارية

تُنشأ العلامة التجارية أولًا، ثم مواردها. ويُدرج المورد الذي يفشل في brand.assetErrors — مع فهرسه ورمزه ورسالته — وتُحفظ الموارد الأخرى.

الأخطاء

الرمزالحالةمتى
invalid_name400لا يوجد اسم، أو الاسم فارغ.
invalid_field400حقل غير معروف في identity أو platform، أو قيمة من نوع خاطئ.
unsupported_logo400البايتات ليست صورة SVG أو PNG أو JPEG أو WebP.
unsafe_svg400ملف SVG يحمل نصًا برمجيًا أو معالج أحداث أو HTML مضمّنًا أو رابطًا خارجيًا.
too_many_logos400أكثر من 12 شعارًا.
logo_too_large413شعار يتجاوز 5 ميغابايت.
invalid_color400لون ليس قيمة سداسية عشرية، أو دور غير معروف.
too_many_brands403يملك الحساب بالفعل 50 علامة تجارية.