Create a brand
Creates a brand. The CSS must parse as a brand theme; a rejected theme answers 422 with located findings under `fields.css`.
Creates a brand. The CSS must parse as a brand theme; a rejected theme answers 422 with located findings under fields.css. With isDefault, the new brand becomes the default. An organization holds at most 12 brands; creating one more answers 409 with a ConflictError.
apiKeyx-api-key<token>application/json- body
slug*string^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$name*string1 <= length <= 120css?|nullassets?|nullfooter?|nullisDefault?boolean|nullSuccess
application/json- response
id*BrandId^brand_[0-9a-hjkmnp-tv-z]{16,24}$slug*stringThe brand's handle, unique in the organization; samva:brand/<slug> names it.
^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$name*stringisDefault*booleanWhether bare samva:brand and domains without a brand resolve to this brand.
css*stringBrand theme CSS: @theme variables, one dark-mode @theme of colors, and @font-face rules with https WOFF2 sources.
assets*footer*digest*stringSHA-256 of the brand's css, assets and footer. A publication built against a different digest predates the brand's current content.
createdAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.brands.create({
"slug": "example",
"name": "example"
});{
"id": "string",
"slug": "string",
"name": "string",
"isDefault": true,
"css": "string",
"assets": {
"logoUrl": "string",
"logoDarkUrl": "string",
"iconUrl": "string"
},
"footer": {
"companyName": "string",
"websiteUrl": "string",
"address": {
"street1": "string",
"street2": "string",
"city": "string",
"region": "string",
"postalCode": "string",
"country": "string"
},
"socialLinks": [
{
"label": "string",
"url": "string"
}
]
},
"digest": "string",
"createdAt": "string",
"updatedAt": "string"
}