Authentication
Summary
A workspace API key authenticates every request. This page covers how to get, send, check and replace a key. It does not cover the capability of each operation; see the API reference.
Send the key
Every request sends a workspace API key as a bearer token:
A browser session cookie is never accepted. The key alone selects its workspace: a workspace selection header is ignored for key callers, so do not send one.
Get a key
Keys are managed in the Rasen app, on the Developers page under API keys. Any active, platform-eligible member of the workspace, whatever their role, can create, list, rotate and revoke the workspace’s keys, including a key another member created.
- A key has a name of 1 to 120 characters and an optional expiry of 1 to 3650 days, or none.
- The value is shown once, when the key is created or rotated. Store it in a secret manager and never commit it. The app cannot show it again; if you lose it, rotate the key.
- Key metadata (name, prefix, state, timestamps, revocation reason and creator) is shown in the app. The app never shows a stored hash or the value again.
last_used_atis a best-effort recorded use of the key on dedicated-host/v1. The platform tries to record a use at most once per key every five minutes, and never delays or fails a request to do so. It promises no freshness: a use that could not be recorded is skipped, so the value can be older than the key’s real last use, by more than five minutes. A null means no use was recorded, not that the key was never used; the app shows “No use recorded”.
An API key cannot list, create, change, rotate or revoke keys, and cannot reach the app’s private routes. Key management needs a signed-in session.
One key family, full access
There is one key family, with full access to every operation in this API. There are no per-role or
per-operation key permissions. GET /context reports what the key can do:
Each operation in the API reference names the capability it needs (x-capability). These labels
describe the operation; they do not add restrictions by member role.
Keys belong to the workspace
A key belongs to its workspace, not to the member who created it. creator_id is audit information
only: a key keeps working when its creator leaves the workspace or changes role.
A key stops working when it expires or is revoked, and the API then answers 401 unauthenticated.
A key created before this API existed, with narrower permissions, is not accepted either: it also
answers 401. Create a new key on the Developers page.
The key’s state and the workspace’s state are checked again on every request. Revocation takes effect for every request admitted after it; a call already admitted keeps its normal lifecycle.
While a workspace is suspended, reads and key revocation still work, but new keys, rotations,
calls and configuration changes are refused: an API change answers 409 workspace_unavailable.
Replace a key
Rotating a key in the app revokes the old key and mints a new one with the same absolute expiry (or none), in one step. An expired key cannot be rotated: create a new key instead.
To replace a key without a gap:
- Create a second key in the app.
- Deploy it, and check it with
GET /context. - Revoke the old key.
Every example on this site uses a placeholder such as <your key> or $RASEN_API_KEY. Never paste
a real key into a page, a ticket or a chat.