Edit a brand rule
PATCH
/api/v1/brand/rules/{id}
const url = 'http://localhost:3000/api/v1/brand/rules/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example","label":"example","value":"example","spec":"example","usage":"example","context":"example","assets":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rendition":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://localhost:3000/api/v1/brand/rules/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example", "label": "example", "value": "example", "spec": "example", "usage": "example", "context": "example", "assets": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rendition": "example" } ] }'A new key renames the rule and its context versions. The type never changes: delete and recreate.
Scope: write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Rule id
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
key
Renames the rule and its context versions, which share a key
string
value
Checked against the rule’s type, which never changes
spec
Checked against the rule’s type, like value; null clears
Examplegenerated
{ "key": "example", "label": "example", "value": "example", "spec": "example", "usage": "example", "context": "example", "assets": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rendition": "example" } ]}Responses
Section titled “Responses”The rule
Media typeapplication/json
object
data
required
object
id
required
string format: uuid
brand
required
The brand’s slug
string
key
required
Dotted, e.g. color.primary
string
label
required
The heading readers see; null: the key, in words
string | null
context
required
Null: the default
string | null
type
required
string
value
required
Any of:
string
number
Array<string | number>
object
family
required
string
size
Pixels
number
weight
400 regular, 700 bold
integer
usage
required
string | null
assets
required
Assets it points at, in order: /a/{id}, or /a/{id}/{rendition} when it names one
Array<object>
updatedAt
required
string format: date-time
Example
{ "data": { "type": "color" }}default
Section titled “default”An error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}