Skip to Content

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
/v1/brands/{slug}

Updates a brand. Each section given replaces that section whole. Published templates keep the brand they were built against until they are republished.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

slug*string
Match^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

Request Body

application/json
  1. body
newSlug?|null
name?|null
css?|null
assets?|null
footer?|null

Response Body

Brand

application/json
  1. response
id*BrandId
Match^brand_[0-9a-hjkmnp-tv-z]{16,24}$
slug*string

The 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*string
isDefault*boolean

Whether bare samva:brand and domains without a brand resolve to this brand.

css*string

Brand theme CSS: @theme variables, one dark-mode @theme of colors, and @font-face rules with https WOFF2 sources.

assets*
footer*
digest*string

SHA-256 of the brand's css, assets and footer. A publication built against a different digest predates the brand's current content.

createdAt*string
updatedAt*string
Example Request
import { 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"
}

Related documentation