authentication
Every API request needs a bearer token. Tokens are workspace-scoped: a key created under workspace Acme can only read/write Acme's data.
/account/api-keyswhlk_... token immediately — it's shown onceForgot to copy? You'll need to revoke the key and create a new one. Whitelabel can't retrieve the full token after creation (we only store an HMAC).
Put the key in the Authorization header on every request:
curl https://app.whitelabel.dev/api/v1/workspaces \
-H "Authorization: Bearer whlk_..."
From Node.js:
const res = await fetch('https://app.whitelabel.dev/api/v1/workspaces', {
headers: { 'Authorization': `Bearer ${process.env.WHITELABEL_API_KEY}` }
})
const json = await res.json()
From Python:
import os, httpx
r = httpx.get(
'https://app.whitelabel.dev/api/v1/workspaces',
headers={'Authorization': f'Bearer {os.environ["WHITELABEL_API_KEY"]}'}
)
If a key leaks: revoke it at /account/api-keys. Revocation is immediate — within a second the key starts returning 401.
For a rotating workflow:
prod-2026-q3)| Status | Meaning |
|---|---|
401 | Missing, malformed, expired, or revoked key |
403 | Key is valid but lacks permission for this resource |
404 | Resource doesn't exist OR the key's workspace can't see it (we don't distinguish — security) |
429 | Rate limit. Response includes Retry-After header (seconds) |