# Update branding

<div class="api-op" data-api-operation>
<div class="api-op__main">

<p class="api-endpoint"><span class="method method-patch">PATCH</span> <code>/v1/branding</code></p>

<dl class="api-facts"><div><dt>Scope</dt><dd><code>branding:write</code></dd></div><div><dt>Auth</dt><dd>Secret key (<code>sk_…</code>)</dd></div><div><dt>Since</dt><dd>1.0</dd></div></dl>

## Headers

<ul class="api-fields">
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">OhAuthCat-Version</code> <span class="api-field__type">string</span></p>
Minor version; defaults to the environment's pin.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">Idempotency-Key</code> <span class="api-field__type">string</span></p>
Honoured for 24 h; a replay returns the original response.

<p class="api-field__chips">min length 1 · max length 255</p>
</li>
</ul>

## Request body

<ul class="api-fields">
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">app_name</code> <span class="api-field__type">string or null</span></p>
The app name shown in portal invite emails, 1–100 characters without control characters.

<p class="api-field__chips">max length 100</p>
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">light</code> <span class="api-field__type">BrandingTheme</span></p>
Theme colours as hex (`#rgb` or `#rrggbb`). The portal themes `primary` only (DESIGN.md §6); it always uses its own neutral surfaces and text. The hosted consent screen uses all four (`accent`, or else `primary`, as its accent); unset colours are the product defaults. A theme whose `foreground` or accent has a contrast below 4.5:1 (WCAG AA) on its `background` (or the default background) answers `parameter_invalid` naming the failing colour, for example `light.foreground`.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">dark</code> <span class="api-field__type">BrandingTheme</span></p>
Theme colours as hex (`#rgb` or `#rrggbb`). The portal themes `primary` only (DESIGN.md §6); it always uses its own neutral surfaces and text. The hosted consent screen uses all four (`accent`, or else `primary`, as its accent); unset colours are the product defaults. A theme whose `foreground` or accent has a contrast below 4.5:1 (WCAG AA) on its `background` (or the default background) answers `parameter_invalid` naming the failing colour, for example `light.foreground`.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">logo_url</code> <span class="api-field__type">string (uri) or null</span></p>
A URL returned by `POST /v1/branding/logo` for this environment (logos are served only from the assets host); any other URL answers `parameter_invalid`. `null` or `""` removes the logo.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">font</code> <span class="api-field__type">string or null</span></p>
A font family name of at most 100 characters without `;{}<>"'\\()/*@:` or control characters. The hosted consent screen recognises `system`, `serif` and `mono` and uses the system font for any other value.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">radius</code> <span class="api-field__type">integer or null</span></p>
Corner radius in pixels. Values above 12 are accepted for compatibility but the portal renders at most 12 (DESIGN.md §6) and the hosted consent screen at most 16; new values should be 0–12.

<p class="api-field__chips">min 0 · max 32</p>
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">privacy_url</code> <span class="api-field__type">string (uri) or null</span></p>
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">terms_url</code> <span class="api-field__type">string (uri) or null</span></p>
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">favicon_url</code> <span class="api-field__type">string (uri) or null</span></p>
A URL returned by `POST /v1/branding/favicon` for this environment; `null` or `""` removes it.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">font_url</code> <span class="api-field__type">string (uri) or null</span></p>
A URL returned by `POST /v1/branding/font` for this environment; `null` or `""` removes it.
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">surfaces</code> <span class="api-field__type">BrandingSurfaces</span></p>
Separate branding for the setup portal, the consent screen and emails, each falling back to the main branding field by field. On an update the object replaces the stored sets; `{}` removes them.
</li>
</ul>

## Responses

<ul class="api-responses">
<li class="api-response"><span class="api-status api-status--ok">200</span> <span>OK <span class="api-field__type">Branding</span></span></li>
<li class="api-response"><span class="api-status api-status--bad">400</span> <span>Invalid request. Codes: <a href="/errors/parameter_invalid/">parameter_invalid</a>, <a href="/errors/parameter_missing/">parameter_missing</a>, <a href="/errors/version_unsupported/">version_unsupported</a> and resource-specific codes from the catalogue. <span class="api-field__type">Error</span></span></li>
<li class="api-response"><span class="api-status api-status--bad">401</span> <span>Codes: <a href="/errors/authentication_required/">authentication_required</a>, <a href="/errors/api_key_invalid/">api_key_invalid</a>. <span class="api-field__type">Error</span></span></li>
<li class="api-response"><span class="api-status api-status--bad">403</span> <span>Codes: <a href="/errors/api_key_scope_missing/">api_key_scope_missing</a>, <a href="/errors/ip_not_allowed/">ip_not_allowed</a>, <a href="/errors/plan_limit_reached/">plan_limit_reached</a>. <span class="api-field__type">Error</span></span></li>
<li class="api-response"><span class="api-status api-status--bad">409</span> <span>Codes: <a href="/errors/idempotency_key_reused/">idempotency_key_reused</a> and resource-specific conflicts. <span class="api-field__type">Error</span></span></li>
<li class="api-response"><span class="api-status api-status--bad">429</span> <span>Code: <a href="/errors/rate_limited/">rate_limited</a>. Retry-After is set. <span class="api-field__type">Error</span></span></li>
<li class="api-response"><span class="api-status api-status--bad">503</span> <span>Code: <a href="/errors/service_unavailable/">service_unavailable</a>. Retry-After is set; writes are paused. <span class="api-field__type">Error</span></span></li>
<li class="api-response"><span class="api-status api-status--neutral">default</span> <span>Any other error, including <a href="/errors/internal_error/">internal_error</a>. Every code is in the error catalogue. <span class="api-field__type">Error</span></span></li>
</ul>

Errors share one shape; see the [error code catalogue](/errors/).

</div>
<div class="api-op__code">

**curl**

```sh wrap
curl -X PATCH \
  "https://api.ohauthcat.com/v1/branding" \
  -H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "app_name": "example_app_name",
  "light": {
    "primary": "#C94820",
    "background": "#C94820",
    "foreground": "#C94820",
    "accent": "#C94820"
  },
  "dark": {
    "primary": "#C94820",
    "background": "#C94820",
    "foreground": "#C94820",
    "accent": "#C94820"
  },
  "logo_url": "https://app.acme.com/callback",
  "font": "Inter",
  "radius": 0,
  "privacy_url": "https://app.acme.com/callback",
  "terms_url": "https://app.acme.com/callback",
  "favicon_url": "https://app.acme.com/callback",
  "font_url": "https://app.acme.com/callback",
  "surfaces": {
    "portal": {
      "light": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "dark": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "radius": 0,
      "logo_url": "https://app.acme.com/callback",
      "font": "Inter",
      "favicon_url": "https://app.acme.com/callback",
      "font_url": "https://app.acme.com/callback",
      "logo_url_dark": "https://example.com",
      "colors": {
        "page_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "card_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "muted_text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "accent": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "border": {
          "light": "#C94820",
          "dark": "#C94820"
        }
      }
    },
    "consent": {
      "light": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "dark": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "radius": 0,
      "logo_url": "https://app.acme.com/callback",
      "font": "Inter",
      "favicon_url": "https://app.acme.com/callback",
      "font_url": "https://app.acme.com/callback",
      "logo_url_dark": "https://example.com",
      "colors": {
        "page_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "card_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "muted_text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "accent": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "border": {
          "light": "#C94820",
          "dark": "#C94820"
        }
      }
    },
    "email": {
      "light": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "dark": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "radius": 0,
      "logo_url": "https://app.acme.com/callback",
      "font": "Inter",
      "favicon_url": "https://app.acme.com/callback",
      "font_url": "https://app.acme.com/callback",
      "logo_url_dark": "https://example.com",
      "colors": {
        "page_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "card_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "muted_text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "accent": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "border": {
          "light": "#C94820",
          "dark": "#C94820"
        }
      }
    }
  }
}'
```

**Node**

```javascript wrap
const response = await fetch("https://api.ohauthcat.com/v1/branding", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.OHAUTHCAT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    app_name: "example_app_name",
    light: {
      primary: "#C94820",
      background: "#C94820",
      foreground: "#C94820",
      accent: "#C94820",
    },
    dark: {
      primary: "#C94820",
      background: "#C94820",
      foreground: "#C94820",
      accent: "#C94820",
    },
    logo_url: "https://app.acme.com/callback",
    font: "Inter",
    radius: 0,
    privacy_url: "https://app.acme.com/callback",
    terms_url: "https://app.acme.com/callback",
    favicon_url: "https://app.acme.com/callback",
    font_url: "https://app.acme.com/callback",
    surfaces: {
      portal: {
        light: {
          primary: "#C94820",
          background: "#C94820",
          foreground: "#C94820",
          accent: "#C94820",
        },
        dark: {
          primary: "#C94820",
          background: "#C94820",
          foreground: "#C94820",
          accent: "#C94820",
        },
        radius: 0,
        logo_url: "https://app.acme.com/callback",
        font: "Inter",
        favicon_url: "https://app.acme.com/callback",
        font_url: "https://app.acme.com/callback",
        logo_url_dark: "https://example.com",
        colors: {
          page_background: {
            light: "#C94820",
            dark: "#C94820",
          },
          card_background: {
            light: "#C94820",
            dark: "#C94820",
          },
          text: {
            light: "#C94820",
            dark: "#C94820",
          },
          muted_text: {
            light: "#C94820",
            dark: "#C94820",
          },
          accent: {
            light: "#C94820",
            dark: "#C94820",
          },
          border: {
            light: "#C94820",
            dark: "#C94820",
          },
        },
      },
      consent: {
        light: {
          primary: "#C94820",
          background: "#C94820",
          foreground: "#C94820",
          accent: "#C94820",
        },
        dark: {
          primary: "#C94820",
          background: "#C94820",
          foreground: "#C94820",
          accent: "#C94820",
        },
        radius: 0,
        logo_url: "https://app.acme.com/callback",
        font: "Inter",
        favicon_url: "https://app.acme.com/callback",
        font_url: "https://app.acme.com/callback",
        logo_url_dark: "https://example.com",
        colors: {
          page_background: {
            light: "#C94820",
            dark: "#C94820",
          },
          card_background: {
            light: "#C94820",
            dark: "#C94820",
          },
          text: {
            light: "#C94820",
            dark: "#C94820",
          },
          muted_text: {
            light: "#C94820",
            dark: "#C94820",
          },
          accent: {
            light: "#C94820",
            dark: "#C94820",
          },
          border: {
            light: "#C94820",
            dark: "#C94820",
          },
        },
      },
      email: {
        light: {
          primary: "#C94820",
          background: "#C94820",
          foreground: "#C94820",
          accent: "#C94820",
        },
        dark: {
          primary: "#C94820",
          background: "#C94820",
          foreground: "#C94820",
          accent: "#C94820",
        },
        radius: 0,
        logo_url: "https://app.acme.com/callback",
        font: "Inter",
        favicon_url: "https://app.acme.com/callback",
        font_url: "https://app.acme.com/callback",
        logo_url_dark: "https://example.com",
        colors: {
          page_background: {
            light: "#C94820",
            dark: "#C94820",
          },
          card_background: {
            light: "#C94820",
            dark: "#C94820",
          },
          text: {
            light: "#C94820",
            dark: "#C94820",
          },
          muted_text: {
            light: "#C94820",
            dark: "#C94820",
          },
          accent: {
            light: "#C94820",
            dark: "#C94820",
          },
          border: {
            light: "#C94820",
            dark: "#C94820",
          },
        },
      },
    },
  }),
});
const data = await response.json();
```

**Python**

```python wrap
import os
import requests

response = requests.patch(
    "https://api.ohauthcat.com/v1/branding",
    headers={"Authorization": f"Bearer {os.environ['OHAUTHCAT_API_KEY']}"},
    json={
        "app_name": "example_app_name",
        "light": {
            "primary": "#C94820",
            "background": "#C94820",
            "foreground": "#C94820",
            "accent": "#C94820",
        },
        "dark": {
            "primary": "#C94820",
            "background": "#C94820",
            "foreground": "#C94820",
            "accent": "#C94820",
        },
        "logo_url": "https://app.acme.com/callback",
        "font": "Inter",
        "radius": 0,
        "privacy_url": "https://app.acme.com/callback",
        "terms_url": "https://app.acme.com/callback",
        "favicon_url": "https://app.acme.com/callback",
        "font_url": "https://app.acme.com/callback",
        "surfaces": {
            "portal": {
                "light": {
                    "primary": "#C94820",
                    "background": "#C94820",
                    "foreground": "#C94820",
                    "accent": "#C94820",
                },
                "dark": {
                    "primary": "#C94820",
                    "background": "#C94820",
                    "foreground": "#C94820",
                    "accent": "#C94820",
                },
                "radius": 0,
                "logo_url": "https://app.acme.com/callback",
                "font": "Inter",
                "favicon_url": "https://app.acme.com/callback",
                "font_url": "https://app.acme.com/callback",
                "logo_url_dark": "https://example.com",
                "colors": {
                    "page_background": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "card_background": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "text": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "muted_text": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "accent": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "border": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                },
            },
            "consent": {
                "light": {
                    "primary": "#C94820",
                    "background": "#C94820",
                    "foreground": "#C94820",
                    "accent": "#C94820",
                },
                "dark": {
                    "primary": "#C94820",
                    "background": "#C94820",
                    "foreground": "#C94820",
                    "accent": "#C94820",
                },
                "radius": 0,
                "logo_url": "https://app.acme.com/callback",
                "font": "Inter",
                "favicon_url": "https://app.acme.com/callback",
                "font_url": "https://app.acme.com/callback",
                "logo_url_dark": "https://example.com",
                "colors": {
                    "page_background": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "card_background": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "text": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "muted_text": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "accent": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "border": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                },
            },
            "email": {
                "light": {
                    "primary": "#C94820",
                    "background": "#C94820",
                    "foreground": "#C94820",
                    "accent": "#C94820",
                },
                "dark": {
                    "primary": "#C94820",
                    "background": "#C94820",
                    "foreground": "#C94820",
                    "accent": "#C94820",
                },
                "radius": 0,
                "logo_url": "https://app.acme.com/callback",
                "font": "Inter",
                "favicon_url": "https://app.acme.com/callback",
                "font_url": "https://app.acme.com/callback",
                "logo_url_dark": "https://example.com",
                "colors": {
                    "page_background": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "card_background": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "text": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "muted_text": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "accent": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                    "border": {
                        "light": "#C94820",
                        "dark": "#C94820",
                    },
                },
            },
        },
    },
)
data = response.json()
```

```json title="Response 200" wrap
{
  "object": "branding",
  "app_name": "example_app_name",
  "light": {
    "primary": "#C94820",
    "background": "#C94820",
    "foreground": "#C94820",
    "accent": "#C94820"
  },
  "dark": {
    "primary": "#C94820",
    "background": "#C94820",
    "foreground": "#C94820",
    "accent": "#C94820"
  },
  "logo_url": "https://app.acme.com/callback",
  "font": "Inter",
  "radius": 1,
  "privacy_url": "https://app.acme.com/callback",
  "terms_url": "https://app.acme.com/callback",
  "favicon_url": "https://app.acme.com/callback",
  "font_url": "https://app.acme.com/callback",
  "surfaces": {
    "portal": {
      "light": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "dark": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "radius": 0,
      "logo_url": "https://app.acme.com/callback",
      "font": "Inter",
      "favicon_url": "https://app.acme.com/callback",
      "font_url": "https://app.acme.com/callback",
      "logo_url_dark": "https://example.com",
      "colors": {
        "page_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "card_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "muted_text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "accent": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "border": {
          "light": "#C94820",
          "dark": "#C94820"
        }
      }
    },
    "consent": {
      "light": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "dark": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "radius": 0,
      "logo_url": "https://app.acme.com/callback",
      "font": "Inter",
      "favicon_url": "https://app.acme.com/callback",
      "font_url": "https://app.acme.com/callback",
      "logo_url_dark": "https://example.com",
      "colors": {
        "page_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "card_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "muted_text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "accent": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "border": {
          "light": "#C94820",
          "dark": "#C94820"
        }
      }
    },
    "email": {
      "light": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "dark": {
        "primary": "#C94820",
        "background": "#C94820",
        "foreground": "#C94820",
        "accent": "#C94820"
      },
      "radius": 0,
      "logo_url": "https://app.acme.com/callback",
      "font": "Inter",
      "favicon_url": "https://app.acme.com/callback",
      "font_url": "https://app.acme.com/callback",
      "logo_url_dark": "https://example.com",
      "colors": {
        "page_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "card_background": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "muted_text": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "accent": {
          "light": "#C94820",
          "dark": "#C94820"
        },
        "border": {
          "light": "#C94820",
          "dark": "#C94820"
        }
      }
    }
  }
}
```

</div>
</div>
