OpenFolia

Change the branding

PATCH
/branding

The fields given; left out stays, null is the default again (every field null: reset to the defaults). An image field names an image uploaded with POST /branding/images (else 422 unknown-image); the favicon and the app icon must be square (422 image-not-square, meta.width, meta.height). The primary colour is used as given on light pages, and a lighter one of the same hue is derived for dark pages; the accent tints the light sidebar. Every pair they make is checked, text at 4.5:1 and shapes at 3:1, against the theme's own surfaces: one that falls short is 422 insufficient-contrast, an error per pair with meta.theme, meta.pair, meta.ratio and meta.required, and nothing changes. Status and safety colours are never brandable. Applies at once; audited as branding.update (each field changed, from and to). Needs the admin.branding permission.

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Request Body

application/vnd.api+json
  1. body
data*

Response Body

application/vnd.api+json
  1. response
data*

The platform’s branding. id is always branding. Null fields take the neutral defaults.

Example Request
curl -X PATCH 'http://localhost:3000/branding' \  -H 'Content-Type: application/vnd.api+json' \  -d '{  "data": {    "type": "Branding",    "attributes": {}  }}'
Example Response
{  "data": {    "type": "Branding",    "id": "string",    "attributes": {      "productName": "string",      "logoLight": "string",      "logoDark": "string",      "mark": "string",      "favicon": "string",      "appIcon": "string",      "primary": "string",      "accent": "string",      "updatedAt": "2019-08-24T14:15:22Z"    },    "meta": {      "tokens": {        "light": {          "primary": "string",          "primary-foreground": "string",          "ring": "string",          "accent": "string",          "sidebar": "string",          "sidebar-border": "string",          "sidebar-primary": "string",          "sidebar-primary-foreground": "string",          "sidebar-ring": "string"        },        "dark": {          "primary": "string",          "primary-foreground": "string",          "ring": "string",          "accent": "string",          "sidebar": "string",          "sidebar-border": "string",          "sidebar-primary": "string",          "sidebar-primary-foreground": "string",          "sidebar-ring": "string"        }      },      "contrast": [        {          "theme": "light",          "pair": "string",          "colour": "primary",          "ratio": 0,          "required": 0        }      ]    }  }}