Add a brand rule
const url = 'http://localhost:3000/api/v1/brand/rules';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example","label":"example","context":"example","type":"color","value":"example","usage":"example","assets":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rendition":"example"}],"spec":{"token":"example","group":"example","weight":1,"pair":"example","tints":[1],"cmyk":["example"],"pantone":["example"],"ral":"example","rgb":["example"],"print":"specified","texture":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","gradient":{"kind":"linear","angle":1,"stops":[{"color":"example","at":1,"opacity":1}]}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/brand/rules \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example", "label": "example", "context": "example", "type": "color", "value": "example", "usage": "example", "assets": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rendition": "example" } ], "spec": { "token": "example", "group": "example", "weight": 1, "pair": "example", "tints": [ 1 ], "cmyk": [ "example" ], "pantone": [ "example" ], "ral": "example", "rgb": [ "example" ], "print": "specified", "texture": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "gradient": { "kind": "linear", "angle": 1, "stops": [ { "color": "example", "at": 1, "opacity": 1 } ] } } }'One per key and context; 409 when it exists. value must match type. ?brand= picks the brand; the default otherwise. Every change to rules lands in the brand’s history.
Scope: write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”A brand’s slug
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
A scale name beside the brand name: Pink-500
Primary, Secondary, Neutrals: palettes group by it
Its share of the brand’s color, for the proportion bar
The color set on it: text on this ground, or its light partner
Tint steps in percent: [80, 60, 40, 20]
Free codes, coated and uncoated: 485 C, 485 U
When the book states it rather than deriving it from the hex
Whether the print values were given or converted
An image laid over the swatch
object
Markdown (GFM)
object
object
object
object
ISO 15924: Latn, Arab
OpenType features on: ss01, tnum
Where the family comes from, or its license
A CSS stack: Georgia, serif
False: readers see the face but get no files
Responses
Section titled “Responses”Created
object
object
The brand’s slug
Dotted, e.g. color.primary
The heading readers see; null: the key, in words
Null: the default
object
Pixels
400 regular, 700 bold
Assets it points at, in order: /a/{id}, or /a/{id}/{rendition} when it names one
Example
{ "data": { "type": "color" }}default
Section titled “default”An error
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}