Authentication

Four credentials, for four different callers. Using the wrong one does not half-work — it is refused.

Which credential for which caller

Who is calling decides the credential. Only the first one is allowed anywhere near a browser.
Publishable key — tb_…For the browser. Sent as X-API-Key. Public by design: it ships in the source of a public web page, so anyone can read it. What protects it is your allowed domains, not its secrecy.
Server key — tb_live_…For your backend. Sent as Authorization: Bearer (or X-API-Key). Reaches every agent in one App, limited to the scopes you granted. Created on the API keys page; shown once.
Integration key + secret — tb_srv_… / tbsrv_…For a helpdesk answering one agent's handoffs. Sent as X-Integration-Key and X-Integration-Secret, always together. The secret is shown once and stored as a hash.
Dashboard sessionYou, signed in. An httpOnly cookie the browser sends for you; never something to copy into code. Sensitive changes — minting a server key, changing your account email — ask for your password or a two-factor code again.

How long a dashboard session lasts

The access tokenOne hour. It is renewed in the background while you work, so you are not asked to sign in again — a stolen one is useful for an hour at most.
A password resetSigns you out everywhere: every browser and device holding a session has to sign in again with the new password.
A reused refresh tokenTreated as theft. Each renewal hands out a new refresh token; if an old one is presented again, every session for that account is ended.

NoteWhy the widget key is not a secret

It is in the page source of a public website. Treating it as a secret is the mistake, not the design — the same way a Stripe publishable key or a Maps key is meant to be seen. It buys a visitor the ability to talk to your agent from a domain you approved. It does not read transcripts, change settings, or reach anything else.

The browser: publishable key plus an allowed domain

bash
curl https://api.tigerbase.cloud/chatbots/public/config \
  -H "X-API-Key: tb_your_publishable_key" \
  -H "Origin: https://clinic.example"

With no key at all you get a refusal that names the header, rather than a generic 401:

json
{
  "message": "API key required. Provide it as the X-API-Key header.",
  "error": "Unauthorized",
  "statusCode": 401
}

Allowed domains, exactly

This is the control that actually protects the publishable key, so it is worth knowing precisely how it matches. All of the following was measured against a running agent, not inferred.

An entry of clinic.exampleAllows clinic.example. Nothing else.
www.clinic.exampleRefused by that entry. A bare host does not cover its subdomains — this is the single most common surprise.
An entry of *.clinic.exampleAllows www.clinic.example and booking.clinic.example. Add it alongside the bare host, not instead of it.
clinic.example.attacker.comRefused, even with the wildcard. The match is on the domain, not on how the text ends.
An entry written as a full URLAccepted. https://clinic.example/some/path is read as the host clinic.example; the path is ignored.
localhost and 127.0.0.1Refused in production unless they are on the list. Add localhost as an entry to test a local page against the live service; only a development server lets local pages through on its own.
No Origin or Referer at allRefused in production once the list has entries. A browser always sends one; a request without it is not the caller this check is for.

A domain you did not allow is refused with a sentence written for the visitor, and a reason written for code:

json
{
  "message": "This assistant is not available right now.",
  "error": "Forbidden",
  "statusCode": 403,
  "reason": "domain_not_allowed"
}
no_domains_configuredThe agent's list is empty.
domain_not_allowedThe page's host is not on the list.
no_originThe request carried neither Origin nor Referer.

The response never names the host that was turned away — that goes to the account owner as a notification, so the page that was refused learns nothing about how the account is set up.

WarningAn empty list is refused in production

Not treated as “allow everything”. An agent with no allowed domains cannot answer on a live site at all — the refusal carries reason: "no_domains_configured". In development an empty list is permitted, which is why an agent can appear to work locally and then refuse the moment it is deployed.

Your backend: a server key

The general-purpose credential for server-to-server work: reading conversations and usage, asking an agent, changing settings, answering the handoff queue. Scoped, revocable, and one per integration — see API keys and Keys & scopes.

bash
curl https://api.tigerbase.cloud/v1/agents \
  -H "Authorization: Bearer tb_live_…"

TipWhat a server key cannot do, by design

It reaches only the App it was created in. It can never set an agent's model key, webhook URL or secret, or allowed domains. And it can never be minted with more access than the person who made it has, or without that person confirming their password or a two-factor code first.

Your helpdesk: integration key and secret together

Generated from the agent's Settings page. The response is the only time you will see the secret:

json
{
  "integrationKey": "tb_srv_15d718533c1d962c458d65b896a607cc…",
  "integrationSecret": "tbsrv_2d67aa22a7aa23ecb6d9c9cdab187a98…",
  "warning": "IMPORTANT: Save the integrationSecret now! It will NOT be shown again."
}
bash
curl https://api.tigerbase.cloud/integrations/handoff/conversations \
  -H "X-Integration-Key: tb_srv_…" \
  -H "X-Integration-Secret: tbsrv_…"

No Origin header is needed or expected on either server path. Server-to-server calls never send one, and the domain allowlist does not apply to them.

NoteWhich server credential should I use?

A server key, for anything new. It has scopes, several can exist at once so you can rotate without downtime, and one key can answer the handoff queue for every agent in the App. The integration pair is one credential per agent with no scopes; it keeps working for integrations already built on it.

What happens if you mix them up

Every one of these was run against the live API. None of them half-works, which is the point:

Integration key with no secret401 — “Integration credentials required. Provide X-Integration-Key and X-Integration-Secret.”
A wrong secret401 — “Invalid integration credentials”.
Your publishable key on the integration API401. It is not accepted there under any circumstances.
Your integration key on the widget endpoint401 — “Invalid API key”. The two key spaces do not overlap.
Anything but a tb_live_ key on /v1401 — “That API key is not valid, has been revoked, or has expired.”

NoteRotating, and what it breaks

Generating integration credentials again replaces the old pair immediately — anything still using it starts getting 401s. There is one pair per agent, so rotate when you can update every caller at the same time. Revoking removes the pair entirely and closes the integration API for that agent. Server keys rotate without that gap: mint the new one, move callers, then revoke the old.

CarefulIf a secret leaks, revoke or rotate it

An integration secret reads every handoff conversation that agent has had; a server key with read reads every conversation in its App. Both include whatever your visitors typed. A leaked publishable key is a much smaller matter — tighten the allowed domains and it is worth nothing on any other site.