brand-kits

Create Brand Kit

Changed on

Create a brand kit — from a URL (extraction) or from direct fields (manual).

Pass url to run server-side extraction of brand info from a website, OR pass the manual token fields (colors / fonts / logo_file_ids with a name) to build a kit from what you already hold — the same write the web app's manual onboarding performs, for brands without a website. Those two are mutually exclusive, enforced by the request schema.

name is NOT exclusive with url: send both to extract the brand and title the kit with the name you supply. The extracted company_name is left as extracted — naming a kit is not asserting what the company is called. At least one of url or name is required.

Honors idempotency_key through the shared pipeline (a keyed retry replays the stored result instead of minting a duplicate kit). A stored result whose kit was DELETED since does not replay: the stale record is invalidated and the create re-executes fresh (loud stale_replay_invalidated marker). Brand create is NOT metered on either path — no billing runs here — so the response carries the zero-credit deterministic usage receipt.

post/brand-kits

Request

  • Base URL
    https://api.moda.app/v1
  • URL
    https://api.moda.app/v1/brand-kits
  • Auth
    HTTP bearer

Headers

Moda-Version'2026-04-12' | '2026-05-01'
Example:2026-05-01

Calendar-dated API version pin. New integrations should pin 2026-05-01 to opt into the newest response shapes. For back-compat the server also accepts requests with no header and resolves them to the current default (today: 2026-04-12); that default advances on each sunset date. Any unsupported value returns 400 unsupported_version.

Request body

urlstring nullable

Company website URL or domain (e.g. 'stripe.com') to extract brand data from. Mutually exclusive with the manual TOKEN fields (colors / fonts / logo_file_ids). name may accompany it: it titles the kit. The extracted company_name is left as extracted — naming a kit is not asserting the company's name.

namestring nullable

Display name for the kit. On the MANUAL path it is also stored as the kit's company_name. Required there, and OPTIONAL alongside url, where it titles the kit only — extraction keeps ownership of company_name (ENG-5415).

colorsobject[] nullable

Manual path only: initial palette as an array of {color, label?, mode?, gradient?} objects (color is a hex string, e.g. '#0F172A'; mode is 'light' / 'dark' / 'any'). Same shape as the PATCH colors field.

fontsobject[] nullable

Manual path only: initial fonts as an array of {family, label?, weight?} objects. Same shape as the PATCH fonts field. Each font's supported flag is derived server-side from the platform + team font catalogs; a caller-supplied value is ignored.

logo_file_idsstring[] nullable

Manual path only: file_ IDs (from POST /v1/uploads) to attach as logos. Files must be images (image/*). Equivalent to calling addBrandKitImage with role='logo' for each after create, but atomic with the create itself.

idempotency_keystring nullable

A retried create with the same key replays the stored result (replayed: true) instead of creating a second brand kit. Same-key reuse with a different payload is a 409 idempotency_conflict.

Example request

{
  "logo_file_ids": [
    "file_01HT9WK8N3M2J4A5Z6P7Q8R9TV"
  ]
}

Response

Successful Response

object required

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      request property list-of-types was widened by adding types null to media type application/json

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status