Authorization header.
Creating an API key
- Go to the API settings page
- Click Create New Key
- Copy the key immediately. It won’t be shown again
What a key can do
An API key acts for its whole workspace. It can call every operation in this API reference, and do everything each one offers: a key has no role and is never refused for a permission. Where an operation is limited to admins in the app, a key counts as an admin. People signed in to the Clustr app call the same operations with the rights of their role. The operations this reference leaves out (signing in, managing API keys, Clustr staff tools, the app’s own screens) do not take an API key, and answer403.
An organization’s own operations (its workspaces, usage, audit log and webhook) take an
organization key instead.
Check a key
GET /v2/api_keys/current answers 200 with your workspace id when the key works. Tools that
offer a “test connection” button can call it.
Example
Error responses
Every error answers the same envelope, with a
request_id to quote to support. See
Errors for the envelope and every code.
Signing in from the Clustr web app
The Clustr web app does not use API keys and holds no token. It sends the person toGET /v2/auth/login?return_to=/accounts, which goes to the Clustr sign-in page. The sign-in page
comes back to GET /v2/auth/callback, which leaves a session in a secure, httpOnly cookie on api.clustr-ai.com. The app then calls the API
with the browser’s credentials (credentials: 'include'), and POST /v2/auth/logout signs out.
These routes are for the Clustr app only: a change made with the session cookie must come from the
app’s own address, and any other is refused with 403. Integrations keep using API keys as above.