Update a brand
Updates a brand. Each section given replaces that section whole. Published templates keep the brand they were built against until they are republished.
PATCH
Updates a brand. Each section given replaces that section whole. Published templates keep the brand they were built against until they are republished.
apiKeyheader
x-api-key<token>slug*stringMatch
^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$application/json- body
newSlug?|nullname?|nullcss?|nullassets?|nullfooter?|nullBrand
application/json- response
id*BrandIdMatch
^brand_[0-9a-hjkmnp-tv-z]{16,24}$slug*stringThe brand's handle, unique in the organization; samva:brand/<slug> names it.
Match
^[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.update({
"slug": "example"
});Example Response
{
"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"
}