> ## Documentation Index
> Fetch the complete documentation index at: https://docs.artbucket.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Change a brand's theme

> Merges: a key left out keeps its value, null clears it. A color setting names a color rule, a font setting a font rule, `logo` a rule with a picture and `device` an image asset: a 422 names each that doesn't, with its path. Answers with the look and its `checks`, as GET does. A draft in the brand's history until it is published.

Scope: `write`.



## OpenAPI

````yaml /openapi.json patch /api/v1/brands/{slug}/theme
openapi: 3.1.0
info:
  title: artbucket
  version: '1'
  description: >-
    Agent-first asset management. The web UI is built on this API and nothing
    else, beside signing in at /api/auth. Send `Authorization: Bearer <key>`: a
    key works in one workspace with one scope, and scopes are a ladder: read <
    propose < write < admin. People signed in to the app carry a session cookie
    instead, and their scope is what their grants add up to: on the
    organization, the workspace, or single collections and assets. A scope shown
    as needed on the workspace is also enough on the one collection or asset a
    route acts on. Agents (MCP at POST /api/v1/mcp) usually get `propose`: what
    they add waits for a human.
servers:
  - url: http://localhost:3000
security:
  - bearer: []
  - session: []
  - {}
paths:
  /api/v1/brands/{slug}/theme:
    parameters:
      - name: slug
        in: path
        required: true
        description: Brand slug
        schema:
          type: string
    patch:
      summary: Change a brand's theme
      description: >-
        Merges: a key left out keeps its value, null clears it. A color setting
        names a color rule, a font setting a font rule, `logo` a rule with a
        picture and `device` an image asset: a 422 names each that doesn't, with
        its path. Answers with the look and its `checks`, as GET does. A draft
        in the brand's history until it is published.


        Scope: `write`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accent:
                  description: >-
                    Color rule for links, marks and brand grounds;
                    color.primary, brand or accent when left out
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                accentUse:
                  anyOf:
                    - description: 'hairline: the accent draws rules and marks, never fills'
                      type: string
                      enum:
                        - fill
                        - hairline
                    - type: 'null'
                surface:
                  description: >-
                    The page ground; color.background, surface or paper when
                    left out, else the app's
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                panel:
                  description: >-
                    Panels and alternate sections; a step off the surface when
                    left out
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                dark:
                  description: The dark ground
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                ink:
                  description: >-
                    Text; color.ink, text or foreground when left out, else
                    black or white by contrast
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                muted:
                  description: Quiet text; mixed from ink and surface when left out
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                head:
                  description: Font rule for headings
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                body:
                  description: Font rule for text
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                label:
                  description: >-
                    Font rule for eyebrows, labels and running heads; its
                    spec.case and spec.tracking set them
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                logo:
                  description: >-
                    The rule whose picture is the site's mark; logo.primary,
                    mark or wordmark when left out
                  anyOf:
                    - type: string
                      maxLength: 120
                      pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                    - type: 'null'
                device:
                  description: >-
                    An SVG asset: the brand's symbol or pattern for covers,
                    dividers and pattern grounds
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([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)$
                    - type: 'null'
                radius:
                  anyOf:
                    - description: Corner radius in px
                      type: integer
                      minimum: 0
                      maximum: 40
                    - type: 'null'
                width:
                  anyOf:
                    - type: string
                      enum:
                        - narrow
                        - normal
                        - wide
                    - type: 'null'
                density:
                  anyOf:
                    - type: string
                      enum:
                        - compact
                        - normal
                        - airy
                    - type: 'null'
                scale:
                  anyOf:
                    - description: Heading size ratio; 1.25 when left out
                      type: number
                      minimum: 1.067
                      maximum: 1.618
                    - type: 'null'
                nav:
                  anyOf:
                    - type: string
                      enum:
                        - sidebar
                        - top
                        - overlay
                    - type: 'null'
                band:
                  anyOf:
                    - description: >-
                        Every page opens on a band of the brand color; header
                        band says the same
                      type: boolean
                    - type: 'null'
                header:
                  anyOf:
                    - description: >-
                        A page's opening: on the page, on a band of the brand
                        color, or beside its cover
                      type: string
                      enum:
                        - plain
                        - band
                        - split
                    - type: 'null'
                separation:
                  anyOf:
                    - description: >-
                        Between two sections on the page's own ground: space
                        alone, or a hairline too
                      type: string
                      enum:
                        - space
                        - hairline
                    - type: 'null'
                numbering:
                  anyOf:
                    - description: 'Number chapters and pages: 01, 01.2'
                      type: boolean
                    - type: 'null'
                motion:
                  anyOf:
                    - description: >-
                        subtle: sections reveal as they scroll in; never with
                        reduced motion
                      type: string
                      enum:
                        - none
                        - subtle
                    - type: 'null'
                toc:
                  anyOf:
                    - description: >-
                        On this page: a side column, a list under the page
                        header, or hidden
                      type: string
                      enum:
                        - side
                        - inline
                        - none
                    - type: 'null'
                languages:
                  anyOf:
                    - description: >-
                        The languages readers pick from; the first is the one
                        the pages are written in
                      maxItems: 12
                      type: array
                      items:
                        type: object
                        properties:
                          code:
                            type: string
                            maxLength: 20
                            pattern: ^[a-z]{2,3}(-[a-z0-9]{2,8})?$
                          label:
                            type: string
                            minLength: 1
                            maxLength: 40
                          dir:
                            description: From the language when left out
                            type: string
                            enum:
                              - ltr
                              - rtl
                        required:
                          - code
                          - label
                        additionalProperties: false
                    - type: 'null'
              additionalProperties: false
      responses:
        '200':
          description: The theme
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      brand:
                        type: string
                      settings:
                        type: object
                        properties:
                          accent:
                            description: >-
                              Color rule for links, marks and brand grounds;
                              color.primary, brand or accent when left out
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          accentUse:
                            description: >-
                              hairline: the accent draws rules and marks, never
                              fills
                            type: string
                            enum:
                              - fill
                              - hairline
                          surface:
                            description: >-
                              The page ground; color.background, surface or
                              paper when left out, else the app's
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          panel:
                            description: >-
                              Panels and alternate sections; a step off the
                              surface when left out
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          dark:
                            description: The dark ground
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          ink:
                            description: >-
                              Text; color.ink, text or foreground when left out,
                              else black or white by contrast
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          muted:
                            description: >-
                              Quiet text; mixed from ink and surface when left
                              out
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          head:
                            description: Font rule for headings
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          body:
                            description: Font rule for text
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          label:
                            description: >-
                              Font rule for eyebrows, labels and running heads;
                              its spec.case and spec.tracking set them
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          logo:
                            description: >-
                              The rule whose picture is the site's mark;
                              logo.primary, mark or wordmark when left out
                            anyOf:
                              - type: string
                                maxLength: 120
                                pattern: ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)*$
                              - type: 'null'
                          device:
                            description: >-
                              An SVG asset: the brand's symbol or pattern for
                              covers, dividers and pattern grounds
                            anyOf:
                              - type: string
                                format: uuid
                                pattern: >-
                                  ^([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)$
                              - type: 'null'
                          radius:
                            description: Corner radius in px
                            type: integer
                            minimum: 0
                            maximum: 40
                          width:
                            type: string
                            enum:
                              - narrow
                              - normal
                              - wide
                          density:
                            type: string
                            enum:
                              - compact
                              - normal
                              - airy
                          scale:
                            description: Heading size ratio; 1.25 when left out
                            type: number
                            minimum: 1.067
                            maximum: 1.618
                          nav:
                            type: string
                            enum:
                              - sidebar
                              - top
                              - overlay
                          band:
                            description: >-
                              Every page opens on a band of the brand color;
                              header band says the same
                            type: boolean
                          header:
                            description: >-
                              A page's opening: on the page, on a band of the
                              brand color, or beside its cover
                            type: string
                            enum:
                              - plain
                              - band
                              - split
                          separation:
                            description: >-
                              Between two sections on the page's own ground:
                              space alone, or a hairline too
                            type: string
                            enum:
                              - space
                              - hairline
                          numbering:
                            description: 'Number chapters and pages: 01, 01.2'
                            type: boolean
                          motion:
                            description: >-
                              subtle: sections reveal as they scroll in; never
                              with reduced motion
                            type: string
                            enum:
                              - none
                              - subtle
                          toc:
                            description: >-
                              On this page: a side column, a list under the page
                              header, or hidden
                            type: string
                            enum:
                              - side
                              - inline
                              - none
                          languages:
                            description: >-
                              The languages readers pick from; the first is the
                              one the pages are written in
                            maxItems: 12
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: string
                                  maxLength: 20
                                  pattern: ^[a-z]{2,3}(-[a-z0-9]{2,8})?$
                                label:
                                  type: string
                                  minLength: 1
                                  maxLength: 40
                                dir:
                                  description: From the language when left out
                                  type: string
                                  enum:
                                    - ltr
                                    - rtl
                              required:
                                - code
                                - label
                              additionalProperties: false
                        additionalProperties: false
                        description: >-
                          Which rule plays which part, and the page's measure,
                          rhythm and chrome; left out: read from the rules
                      theme:
                        type: object
                        properties:
                          v1:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                            description: >-
                              The accent, lifted for light and dark pages, and
                              the faces, as before W3
                          surface:
                            anyOf:
                              - type: string
                                description: A hex color
                              - type: 'null'
                            description: >-
                              The page ground; null: none set or named, so the
                              page keeps the app's, light or dark
                          panel:
                            type: string
                            description: A hex color
                          dark:
                            type: string
                            description: A hex color
                          ink:
                            type: string
                            description: A hex color
                          muted:
                            type: string
                            description: A hex color
                          onDark:
                            type: string
                            description: A hex color
                          mutedOnDark:
                            type: string
                            description: A hex color
                          accent:
                            type: string
                            description: 'The fill, as the brand has it: bands and buttons'
                          accentText:
                            type: string
                            description: >-
                              The accent where it is text (links), at 4.5:1 on
                              the surface
                          onAccent:
                            type: string
                            description: A hex color
                          accentUse:
                            type: string
                            enum:
                              - fill
                              - hairline
                          line:
                            type: string
                            description: A hex color
                          faces:
                            type: object
                            properties:
                              head:
                                type: object
                                properties:
                                  family:
                                    type: string
                                  weight:
                                    type: number
                                  file:
                                    description: The font file for its weight
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([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)$
                                  files:
                                    description: >-
                                      Every font file of the rule, one
                                      @font-face each
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          format: uuid
                                          pattern: >-
                                            ^([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)$
                                        filename:
                                          type: string
                                        mime:
                                          type: string
                                      required:
                                        - id
                                        - filename
                                        - mime
                                      additionalProperties: false
                                  fallback:
                                    type: string
                                  google:
                                    description: >-
                                      From Google Fonts, with no files: its CSS
                                      is imported
                                    type: boolean
                                    const: true
                                required:
                                  - family
                                additionalProperties: false
                              body:
                                type: object
                                properties:
                                  family:
                                    type: string
                                  weight:
                                    type: number
                                  file:
                                    description: The font file for its weight
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([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)$
                                  files:
                                    description: >-
                                      Every font file of the rule, one
                                      @font-face each
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          format: uuid
                                          pattern: >-
                                            ^([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)$
                                        filename:
                                          type: string
                                        mime:
                                          type: string
                                      required:
                                        - id
                                        - filename
                                        - mime
                                      additionalProperties: false
                                  fallback:
                                    type: string
                                  google:
                                    description: >-
                                      From Google Fonts, with no files: its CSS
                                      is imported
                                    type: boolean
                                    const: true
                                required:
                                  - family
                                additionalProperties: false
                              label:
                                type: object
                                properties:
                                  family:
                                    type: string
                                  weight:
                                    type: number
                                  file:
                                    description: The font file for its weight
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([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)$
                                  files:
                                    description: >-
                                      Every font file of the rule, one
                                      @font-face each
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          format: uuid
                                          pattern: >-
                                            ^([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)$
                                        filename:
                                          type: string
                                        mime:
                                          type: string
                                      required:
                                        - id
                                        - filename
                                        - mime
                                      additionalProperties: false
                                  fallback:
                                    type: string
                                  google:
                                    description: >-
                                      From Google Fonts, with no files: its CSS
                                      is imported
                                    type: boolean
                                    const: true
                                  case:
                                    type: string
                                  tracking:
                                    type: number
                                    description: In em
                                required:
                                  - family
                                  - case
                                  - tracking
                                additionalProperties: false
                            additionalProperties: false
                          radius:
                            type: number
                          width:
                            type: string
                            enum:
                              - narrow
                              - normal
                              - wide
                          density:
                            type: string
                            enum:
                              - compact
                              - normal
                              - airy
                          scale:
                            type: number
                          device:
                            anyOf:
                              - type: string
                                format: uuid
                                pattern: >-
                                  ^([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)$
                              - type: 'null'
                          logo:
                            anyOf:
                              - type: object
                                properties:
                                  key:
                                    type: string
                                required:
                                  - key
                                additionalProperties: false
                              - type: 'null'
                          nav:
                            type: string
                            enum:
                              - sidebar
                              - top
                              - overlay
                          band:
                            type: boolean
                            description: header is band
                          header:
                            type: string
                            enum:
                              - plain
                              - band
                              - split
                          separation:
                            type: string
                            enum:
                              - space
                              - hairline
                          numbering:
                            type: boolean
                          motion:
                            type: string
                            enum:
                              - none
                              - subtle
                          toc:
                            type: string
                            enum:
                              - side
                              - inline
                              - none
                            description: >-
                              On this page: a side column, a list under the page
                              header, or none
                          checks:
                            type: array
                            items:
                              type: object
                              properties:
                                pair:
                                  type: string
                                  description: Which color on which, e.g. ink on surface
                                fg:
                                  type: string
                                bg:
                                  type: string
                                ratio:
                                  type: number
                                need:
                                  type: number
                                  description: >-
                                    The contrast it must reach: 4.5 for text, 3
                                    for marks
                                ok:
                                  type: boolean
                                used:
                                  type: string
                                  description: >-
                                    The color used: fg when it passes, else its
                                    fallback
                              required:
                                - pair
                                - fg
                                - bg
                                - ratio
                                - need
                                - ok
                                - used
                              additionalProperties: false
                            description: >-
                              Contrast of each pair in the look: one that fails
                              falls back to a color that reads, and says which
                        required:
                          - v1
                          - surface
                          - panel
                          - dark
                          - ink
                          - muted
                          - onDark
                          - mutedOnDark
                          - accent
                          - accentText
                          - onAccent
                          - accentUse
                          - line
                          - faces
                          - radius
                          - width
                          - density
                          - scale
                          - device
                          - logo
                          - nav
                          - band
                          - header
                          - separation
                          - numbering
                          - motion
                          - toc
                          - checks
                        additionalProperties: false
                        description: >-
                          The look the settings and rules give: grounds, inks,
                          accent, faces and chrome
                      checks:
                        type: array
                        items:
                          type: object
                          properties:
                            pair:
                              type: string
                              description: Which color on which, e.g. ink on surface
                            fg:
                              type: string
                            bg:
                              type: string
                            ratio:
                              type: number
                            need:
                              type: number
                              description: >-
                                The contrast it must reach: 4.5 for text, 3 for
                                marks
                            ok:
                              type: boolean
                            used:
                              type: string
                              description: >-
                                The color used: fg when it passes, else its
                                fallback
                          required:
                            - pair
                            - fg
                            - bg
                            - ratio
                            - need
                            - ok
                            - used
                          additionalProperties: false
                        description: >-
                          Contrast of each pair in the look: one that fails
                          falls back to a color that reads, and says which
                      warnings:
                        type: array
                        items:
                          type: string
                        description: >-
                          Settings naming a rule that has gone since (the
                          default is used), and each pair that fell back
                    required:
                      - brand
                      - settings
                      - theme
                      - checks
                      - warnings
                    additionalProperties: false
                required:
                  - data
                additionalProperties: false
        default:
          description: An error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      detail: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: 'An API key: ab_...'
    session:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Signed in, at /api/auth

````