Authentication
One site key per workspace, safe anywhere, plus an identity secret if your site has logged-in users.
Every /external/* request is authenticated with one HTTP header:
X-Api-Key: brandfine_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxThe key resolves to exactly one workspace. Brandfine works out which site's content to return from the key alone: no workspace ID or tenant slug in the URL.
Your two credentials
| Site key | Identity secret | |
|---|---|---|
| Looks like | brandfine_pk_… | 64 hex characters |
| Where | Anywhere: server, build, browser, a PUBLIC_ / NEXT_PUBLIC_ env var | Your server only, never a browser |
| Does | Reads published content, does what visitors do (forms, bookings, chat, analytics) | Signs a logged-in visitor so chat and bookings trust who they are |
| Need it? | Every site | Only sites with user accounts |
The site key can't write content, change settings or read private data (traffic numbers, inbox, AI insights): those happen in Brandfine, through MCP, or through an app connected with Connect. So a leaked site key exposes nothing that isn't already public on your site.
Getting them
- Sign in to Brandfine at
app.brandfine.co. - Open your workspace → Access → API keys.
- Copy the Site key. If your site has logged-in users, also Reveal the Identity secret.
Convention for env vars: BRANDFINE_API_KEY for the site key,
BRANDFINE_IDENTITY_SECRET for the identity secret.
Keys from before October 2026
Workspaces created earlier also have a workspace key
(brandfine_… without _pk_), shown under Legacy workspace key.
It keeps working with exactly the site key's reach on routes a server
calls, so nothing you built breaks. Two differences:
- Browser-only routes (the chat widget, the analytics tag) take the site key alone. Don't put a legacy key in a web page.
- Until you Rotate the identity secret, it is derived from the legacy key, so keep that key private. Rotating cuts the link.
Switch your sites to the site key when convenient.
What the site key can do
GET /external/workspace: name, languages, display settingsGET /external/posts,/posts/:slug,/categories,/post-types,/navigations/:key: published content onlyPOST /external/submissions: contact formsGET /external/analytics-config: the analytics tag's setupGET /external/appointments/availability,POST …/requests,POST …/requests/lookup: bookings (a visitor's own bookings need a signed identity)/external/live-chat/*: the chat widget
It cannot:
- Write any data (content and settings change in Brandfine).
- Read private data or other workspaces' data.
- Reach internal
/ws/<team>/*endpoints (those use session, MCP or service-key auth).
Rate limits
Content reads with the site key are metered per client IP: 3000 a
minute by default. Past it you get 429 with Retry-After. A build
that renders a large site from one machine stays well inside it.
Errors
| Code | Meaning |
|---|---|
401 | Missing, invalid or revoked key, or a key not allowed on that route. |
404 | The resource exists for some workspace but not yours, OR doesn't exist at all. (Returned uniformly to avoid leaking workspace existence.) |
429 | Rate limited. Back off for Retry-After seconds. |
5xx | Brandfine server issue. The SDK serves stale cache on these; you should too. |