API tokens
An API token is a secret key that lets a program, rather than a person in a browser, talk to SHADE. The main kinds: a build token, which the website build uses to fetch published content and to report how each build went; a read token, which only fetches published content (another site or app); an MCP token, which connects an AI assistant (such as Claude Desktop) as an AI account; a data token for other systems; and an automation token for an admin's own trusted scripts, such as a content import. Every token acts as one team member and can do no more than that team member may. Admins create and revoke tokens on the API tokens screen.
What users can do
Admins:
- See every token of the instance (not only their own): name, kind, the first characters of the token, which team member it acts as, when it was last used and when it expires.
- Create a token with a name, a kind (
build,read,mcp,dataorautomation), the team member it acts as and an expiry (never, in 30 days, in 90 days, in a year). A data token also gets its collections, each Read or Read and write. An automation token always acts as the admin who makes it, always expires, and gets the actions it may take, chosen from that admin's own. - Copy the new token's value once, right after creating it. It is never shown again.
- Revoke a token. Whatever uses it stops working immediately.
- See a token's recent calls: when, the method, the route, the status and how long it took, newest first, filtered by succeeded (2xx), refused (4xx) or failed (5xx).
Programs holding a token:
- A read token: fetch published content (the site build and the preview), and module features that ask for a token.
- A build token: everything a read token may, plus reporting how a site build went, which the site does after each build. The site is set up with one.
- An MCP token: connect an AI assistant as an AI account. See Connecting an AI assistant.
- A data token: another system (a CRM, a shop, a script) manages the collections it was given: list and read entries, and with Read and write also create, change, delete, publish and unpublish them. It acts as its team member, within their rights, and reaches nothing else: no pages, media, users or settings. What it does is in the audit log like an editor's work. Developers find its details in The API.
- An automation token: a trusted script does what the admin's own screens do, without a password or session. It acts as the admin who made it, with what that admin may do now and only the actions chosen for it: a right the admin loses, or an admin who is deactivated or removed, ends it too. It never manages the team, roles, tokens or services, never gives users their roles or changes the security alert rules, never touches the admin's own account (password, two-factor, passkeys, sessions, email, name), never finds or erases a person's data under Privacy, never signs in or signs in again, never exports in bulk (a module's data, a form's submissions as CSV), never removes or uninstalls a module, never changes the email settings (where password links go), and never installs or approves module packages: those are refused to any token, and those actions are never offered.
Editors and AI accounts cannot see or manage tokens.
Who may do it
| Action | Permission | Roles |
|---|---|---|
| See the token list (sidebar entry API tokens) and each token's recent calls | tokens.read | admin |
| Create a token, revoke a token | tokens.manage | admin |
| Use a read token | the owner's own permissions (e.g. content.read, media.read, collections.<slug>.read) | any active team member |
| Report a build with a build token | build.report (only ever for a build token) | admin, editor |
| Use an MCP token | owner must have role ai | ai only |
| Use an automation token | the owner's own permissions and the token's actions, never team.*, tokens.*, services.*, users.roles or errors.manage | admin (who makes it for themselves) |
Editors and the ai role have no tokens.* actions, so only admins manage tokens.
In the admin

API tokens (icon a key) sits in the settings area's Team and access group, next to Team. It is only shown to roles with
tokens.read. The admin is also available in Dutch.
- A note at the top explains the kinds: build tokens let the website build fetch published content and report how each build went; read tokens only fetch published content; MCP tokens connect an AI assistant as an AI account that can read and edit drafts, never publish or delete.
- The table has the columns Name, Kind (a badge
build,read,mcp,data,programorautomation; an automation token also shows how many actions it has, each one on hover), Token (the first characters followed by…, e.g.shd_3fa9c1…), Acts as user (with User deactivated when that team member is deactivated: the token is refused), Last used ("Never" or a relative time) and Expires ("Never" or a date, with Expired once it has passed). Each row has a Recent calls button and, for roles withtokens.manage, a Revoke button. Empty state: "No tokens yet." - New token opens the New API token page, wide enough to choose from, with a summary of what the token gets beside the form (its kind, when it expires and, for an automation token, every action picked):
- Name (required, 1–80 characters), with the hint "Where it is used, e.g. “Website build” or “Claude Desktop – Anna”."
- Kind: Build (website build), Read (published content), MCP (AI assistant), Data (other systems) or Automation (trusted script). Default: Read.
- With kind Automation: Actions, the admin's own actions as checkboxes grouped by name, one group per area, collection or module, collections under the heading of their own group (as on the Roles screen); at least one is required. Start from offers presets that pick what fits (Site content, Build, Read only; Clear takes them all off again), and Search actions narrows the groups. Acts as team member shows "Always you" instead of a list, and Expires offers no Never (In 90 days is chosen when switching to it).
- Acts as user: a list of every active team member as "Name (role)". Empty means Me (the admin creating it). With kind MCP the list only shows AI accounts, and another choice is cleared when switching to MCP. Hint: "MCP tokens must belong to an AI user."
- Expires: Never, In 30 days, In 90 days, In a year, counted from today.
- Create token. On failure a toast "Could not create the token" shows the reason.
- After creation the page shows a warning "Copy this token now / It will not be shown again.", the token in a read-only field with a Copy button (toast "Token copied"), and Done, which leads back to the list. Leaving the page forgets the value.
- Recent calls opens a panel at the side, "Recent calls:
", listing the token's calls newest first, 50 per page: When, Method, Route, Status (green for 2xx, amber for 4xx, red for 5xx) and Duration in milliseconds. Status filters on All, Succeeded (2xx), Refused (4xx) or Failed (5xx). Empty state: "No calls yet." - Revoke asks "Revoke
?" with "Sites and AI clients using it stop working immediately." and deletes the token.
There is no way to rename a token, change its kind, owner or expiry, or show its value again: revoke it and create a new one.
A script that sets an instance up can make a token without the admin, with the same rules: create-token on the
server (Console commands).
On the website
Nothing directly. The site build and the preview fetch content with a build token. Setting up an instance advises a dedicated team member "Site build" (role editor, no password) with a build token. A read token still reads, but the site's build reports are refused with it, so the admin never shows "Site up to date". See Publishing and preview and The website for what the build does with it.
Rules and limits
- Expired tokens are refused at once and listed as Expired; 90 days after expiring they are deleted
automatically (retention kind
expired-tokens, adjustable on the Settings page, see Retention). - Fetching published content has no rate limit: a site build makes bursts of requests. MCP tokens are limited (below).
- Using a token is not audited (it would flood the log); Last used shows activity, updated at most once a minute.
- Recent calls keep every call a token was accepted on: the route as a pattern (
/api/v1/content/collections/:slug, never the address that was called, its ids or its query), the status and the duration. Who called is kept only as a scrambled key (a keyed hash of the IP address), never the address itself, and is not shown. Calls appear within a few seconds. A call with an unknown, expired or wrong kind of token is no token's and is not listed. - Calls are kept 30 days (retention kind
token-requests, at least 7, adjustable under Retention) and at most 10,000 per token, the newest. Revoking a token deletes its calls. They are not part of an instance export (tokens are left out of it) nor of a person's own data.
What a token looks like
- A token starts with
shd_, followed by a long random part. Theshd_start lets secret scanners recognise a leaked token. - SHADE keeps only a scrambled form of the token (a hash), so a leaked database does not leak usable tokens. That is why the value is shown only once. The list shows its first 10 characters.
Creating
- The token acts as the admin creating it unless another team member is chosen; an inactive one is refused ("User is inactive").
- An MCP token must belong to an AI account ("MCP tokens must belong to an AI user"). This keeps an AI client from ever getting a human's permissions.
- A read or build token may belong to any active team member, including an admin or an AI account (an AI account's
build token cannot report builds: the ai role has no
build.report). - An expiry, when set, must be in the future ("Must be in the future").
- An automation token belongs to the admin who makes it ("An automation token acts as the team member who makes
it" for another owner), needs an expiry ("An automation token needs an expiry date") and at least one action, each
one the maker may do now and none of
team.*,tokens.*,services.*,users.rolesanderrors.manage("Not allowed for an automation token: …"). Other kinds take no actions.
Using
- A token works only while it has not expired, its owner is active, and it is used for what its kind is for (a build token also works wherever a read token does). An MCP token also stops when its owner is no longer an AI account. Otherwise the program gets "A valid API token is required".
- Kinds do not overlap: a read or build token does not work for MCP or for managing data, and an MCP token does not fetch published content.
- A program token is made only when an admin approves one of the client's programs, never on this screen (Programs). It fetches published content and manages data, never MCP, and acts as the program with exactly the actions its declaration uses. The list shows it as kind Program, acting as the program; it is revoked with its program, under Programs.
- An automation token works only for what the admin's screens do, never for published content, data or MCP. A program uses either the token or a signed-in session, never both at once. Signing in, the account, the team, roles, tokens, users, services, module packages and approvals, exporting a module's data or a form's submissions, removing or uninstalling a module and saving the email settings refuse any token ("This route takes a signed-in session, never a token"). A change sent from another website is refused as always. What it does is in the audit log under its owner, through API.
- A token carries its owner's role. A read token whose owner may not read a collection is refused for that collection.
- A read token only reads: it gets the reading actions of its owner's role and nothing else, so an admin's read token is not an admin in modules that accept tokens. It never reads the team, tokens or programs, whatever its team member may read.
- A build token is a read token that may also report builds. Only a build token can report a build.
- What is changed with a token shows up in the audit log under the owning team member, through API (or AI (MCP) for an MCP token); see Audit log.
When the owner changes
| Change | Effect on tokens |
|---|---|
| Deactivated | Tokens stay in the list but stop working. Reactivating the team member makes them work again. |
Changes role away from ai | Their MCP tokens are deleted at once. Read tokens stay. |
| Changes role (admin to editor, another custom role) | An automation token keeps only what both its actions and the new role allow. A program's token keeps working: it acts as the program, with its declared actions. |
Becomes ai | Existing tokens stay; read tokens now act with the ai role. |
| Deleted | Their tokens are deleted with them (Team and roles). |
Rate limits (see Request protection)
- MCP: 120 calls a minute per token; more are refused as too many requests.
- Fetching published content has no rate limit of its own. A module feature that accepts tokens has one only if the module sets it.
Audit (see Audit log)
- Creating: action
tokens.manage, "Createdtoken for ", with the owner, kind, first characters and expiry in the details (and an automation token's actions). Never the token itself. - Revoking: action
tokens.manage, "Revoked token", with owner, kind and first characters. - Using a token is not audited (only Last used is updated). A build report is: action
build.report(see Publishing).
For developers
The code and its tests: shade/features/team/README.md in the shade repository.