# Brand a tenant

A tenant is one white-label deployment, and everything cosmetic about it — name, logos,
colors, which surfaces exist — is config you can write from your own tooling. By the end
you have a tenant that renders as your brand instead of the default one.

These three writes need a credential carrying the
[`tenant:config` scope](https://docs.troncharts.xyz/docs/auth/scopes/); an operator grants it on the credential, and
a cookie session cannot stand in for it.

1. ### Read what is set today

   `GET /api/v1/tenants/me` returns the whole config in one round-trip — `branding`,
   `theme`, `flags`, `venues` and `plan`. The path id must be `me` or your own tenant id;
   anything else answers `403 cross_tenant_forbidden`.

   ```bash
   curl -s https://api.troncharts.xyz/api/v1/tenants/me \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG" \
     | jq '{branding, theme, flags}'
   ```

2. ### Set the name and logos

   `brandName` is 1–64 characters. The three URL fields are validated as absolute URLs, so
   a relative path like `/logo.svg` is rejected with `400 invalid_body`. Ship two logo
   variants and the chrome swaps between them per color mode.

   ```bash
   curl -s -X PATCH https://api.troncharts.xyz/api/v1/tenants/me/branding \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG" \
     -H "content-type: application/json" \
     -d '{
       "brandName": "Northwind Markets",
       "logoUrl": "https://cdn.northwind.xyz/logo.svg",
       "logoDarkUrl": "https://cdn.northwind.xyz/logo-dark.svg",
       "faviconUrl": "https://cdn.northwind.xyz/favicon.png"
     }'
   ```

   :::caution
   Each PATCH replaces its whole section rather than merging into it. Omitting
   `faviconUrl` here clears the stored favicon, so read the section first and send the
   full object back with your edits applied.
   :::

3. ### Apply your theme tokens

   Every field is optional. The colors (`bg0`, `panel`, `border`, `text`, `up`, `dn`,
   `primary` and the rest) take any CSS color string up to 64 characters, `radius` is an
   integer 0–24, and `presetId` selects a full palette that the individual tokens then
   layer on top of. Font stacks are applied verbatim — loading the family is your job.

   ```bash
   curl -s -X PATCH https://api.troncharts.xyz/api/v1/tenants/me/theme \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG" \
     -H "content-type: application/json" \
     -d '{
       "primary": "#4f7cff",
       "bg0": "#0b0d10",
       "up": "#22c55e",
       "dn": "#ef4444",
       "radius": 8,
       "fontSans": "Inter, system-ui, sans-serif"
     }'
   ```

4. ### Choose which surfaces exist

   Flags are a flat map of key to boolean, and the response echoes the stored map back.
   Anything you leave out falls back to the platform default rather than staying at its
   previous value.

   ```bash
   curl -s -X PATCH https://api.troncharts.xyz/api/v1/tenants/me/flags \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG" \
     -H "content-type: application/json" \
     -d '{"journal": true, "rewards": true, "news": true, "predictions": false}'
   ```

   :::note
   Flipping a regulated or money-moving flag from `false` to `true` — Polymarket, Kalshi,
   Lighter, HIP-4, copy-trading fees — answers `403 compliance_flag_forbidden` over the
   API no matter which scopes you hold. Turning one off, or re-saving one already on,
   goes through.
   :::

Every write is audited against `provider:<apiClientId>`, and `venues` is deliberately
read-only — enable a venue from the console.

**Next:** [Scopes](https://docs.troncharts.xyz/docs/auth/scopes/) · [Tenancy](https://docs.troncharts.xyz/docs/auth/tenancy/) · [Launch a DEX](https://docs.troncharts.xyz/docs/launch/dex/)