authentication

API Keys

Every API request needs a bearer token. Two flavors: workspace keys (whlk_…) bound to one workspace, and master keys (whlmk_…) that span every workspace you're a member of.

Which key do you want?

Workspace keyMaster key
Prefixwhlk_…whlmk_…
ScopeOne workspaceEvery workspace you're in (including ones you join later)
Scopes / permissionsSelected at issue timeEverything you can do as the issuer
Best forProduction integrations, third-party tools, least-privilegePersonal automation, scripts, CI tasks where workspace boundaries are friction
Blast radius if leakedLimited to one workspaceEvery workspace you're in. Guard like a password.
Who can createOwner/admin in the target workspaceYou (no workspace role check)

Default to workspace keys. Use master only when you actually need cross-workspace access, and prefer revoking + reissuing over passing one around.

Getting a key

  1. Sign in at app.whitelabel.dev
  2. Switch to the workspace you want the key scoped to
  3. Open /account/api-keys
  4. Click Create key, give it a name
  5. Copy the full whlk_... token immediately — it's shown once

Forgot 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).

Using a key

Put the key in the Authorization header on every request:

curl https://app.whitelabel.dev/api/v1/workspaces \
  -H "Authorization: Bearer whlk_..."

Common patterns

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"]}'}
)

Scope rules

Rotating + revoking

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:

  1. Create a new key with a new name (e.g. prod-2026-q3)
  2. Update your application to use the new key
  3. Confirm everything works
  4. Revoke the old key

Errors

StatusMeaning
401Missing, malformed, expired, or revoked key
403Key is valid but lacks permission for this resource
404Resource doesn't exist OR the key's workspace can't see it (we don't distinguish — security)
429Rate limit. Response includes Retry-After header (seconds)