Skip to content

Edit a brand rule

PATCH
/api/v1/brand/rules/{id}
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.

id
required
string

Rule id

Media typeapplication/json
object
key

Renames the rule and its context versions, which share a key

string
<= 120 characters /^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$/
label
Any of:
string
>= 1 characters <= 120 characters
value

Checked against the rule’s type, which never changes

spec

Checked against the rule’s type, like value; null clears

usage
Any of:
string
<= 10000 characters
context
Any of:
string
<= 64 characters /^[a-z0-9]+(-[a-z0-9]+)*$/
assets

Assets it points at, in order: an id, or { id, rendition }. Replaces the list

Array
<= 24 items
Any of:
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
Examplegenerated
{
"key": "example",
"label": "example",
"value": "example",
"spec": "example",
"usage": "example",
"context": "example",
"assets": [
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"rendition": "example"
}
]
}

The rule

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
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
Allowed values: color text number list font
value
required
Any of:
string
spec
required
Any of:
object
key
additional properties
usage
required
string | null
assets
required

Assets it points at, in order: /a/{id}, or /a/{id}/{rendition} when it names one

Array<object>
object
id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
rendition
required
string | null
title
required
string | null
filename
required
string
mime
required
string
width
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
height
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
Example
{
"data": {
"type": "color"
}
}

An error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": "example"
}
}