Skip to content

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; an operator grants it on the credential, and a cookie session cannot stand in for it.

  1. 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.

    Terminal window
    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. 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.

    Terminal window
    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"
    }'
  3. 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.

    Terminal window
    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. 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.

    Terminal window
    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}'

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

Next: Scopes · Tenancy · Launch a DEX