Keys and scopes

What a key may do, which routes each scope opens, and what a key may never do.

The four scopes, and the routes they open

Every /v1 route declares exactly one scope. A key either holds it or is refused — there is no route that two scopes share, and no scope that implies another. write does not include read.

readGET /v1/agentsGET /v1/agents/:publicId/conversationsGET /v1/agents/:publicId/conversations/:visitorGET /v1/usage
chatPOST /v1/agents/:publicId/chat
writePOST /v1/agentsPATCH /v1/agents/:publicIdDELETE /v1/agents/:publicId
handoffGET /v1/handoffsGET /v1/handoffs/:idPOST /v1/handoffs/:id/replyPOST /v1/handoffs/:id/resolve

NoteDeliberately coarse

Fine-grained permissions on a credential nobody can see the effects of produce keys granted everything — because the person creating one cannot tell which scope they need. Four honest buckets are safer than twenty precise ones.

Warningwrite is the one to be careful with

read leaks conversations, which is bad. write leaks the ability to change what the agent is and does — and to create and hide agents. Grant it to the one integration that needs it and nothing else — so that when a key leaks, and one will, the blast radius is that integration.

What happens to every request

Four checks, in this order. The first one that fails decides the answer.

A key reaches only its own App

A key is created inside one App, and every lookup is made inside it: agents, conversations, the handoff queue. Something that belongs to another App — even on the same account — answers 404, exactly like something that never existed, so ids cannot be probed.

A route with no declared scope refuses everyone

The scope is checked by the guard, not inside each handler. A route that forgets to declare one is refused for every key rather than allowed for every key — a missing declaration is a mistake, and the safe reading of a mistake is “not permitted”.

Creating a key

From API keys in the dashboard sidebar. You need permission to manage the App's settings, and two more rules apply, because a key is standing access that outlives the session that made it.

You confirm it is youYour password, or a two-factor code if you have it on. An unlocked laptop is not enough to walk away with a key.
It can do no more than youread and chat need permission to view agents; write needs permission to edit them; handoff needs permission to reply in the inbox. Asking for more is refused.
At least one scopeA key with none can do nothing, so it is refused at creation.
ExpiryA key that carries an expiry date answers 401 after it, exactly like a revoked one.

TipWhy the scope cap matters

Before it, permission to manage settings was enough to mint a key with handoff — and so read an inbox the member could not open themselves. A key is now never a way round your own role.

Rules worth following

One key per integrationNot one per company. When something has to be revoked, you want to revoke the thing that leaked, not everything at once.
Only the scopes it needsA reporting job does not need write. Grant read and it cannot do damage even if it leaks.
Name it so a log makes senseThe dashboard shows a key's prefix and when it was last used. A key called “nightly export” that stopped being used last March is a key to revoke.
Rotate rather than shareMinting a second key and retiring the first is a few seconds. Passing one around is how it ends up somewhere nobody remembers.

What is stored

NoteA hash, never the key

The key is shown once when you create it and cannot be recovered. The prefix is stored in clear so a screen can say which key a row is without being able to reconstruct it. Encrypting instead would mean the database could produce every customer's credentials, for no feature at all.

How it travels

bash
# Preferred
curl https://api.tigerbase.cloud/v1/agents \
  -H "Authorization: Bearer $TIGERBASE_KEY"

# For a caller that cannot set Authorization
curl https://api.tigerbase.cloud/v1/agents \
  -H "X-API-Key: $TIGERBASE_KEY"

The SDK sends it as a bearer token because that is the header a proxy, a log scrubber and a load balancer already know to treat as a credential. The API also accepts X-API-Key for callers that cannot set an Authorization header.

403 Forbidden — missing scope
{
  "statusCode": 403,
  "message": "This key does not have the \"write\" scope.",
  "error": "Forbidden"
}

If a key leaks

Revoke it in the dashboard. Revocation is immediate — the next request carrying it is refused. Then mint a replacement and change the environment variable; in that order, so the window where the leaked key still works is as short as you can make it.