Skip to main content
Every /v1 request authenticates as one of four principals. The server resolves them in a fixed order; the first match wins. session and figma-token principals have no scopes field — they authenticate as a real user and inherit that user’s team memberships. apikey and oauth principals must present an explicit scope per route or get 403 authorization_error: Missing required scope: ....
Scopes are layered on top of, not in place of, the route’s permission check. An ak_live_* key with evaluations:write scoped to team A still cannot write evaluations on team B — assertTeamAccess rejects the team mismatch.
Used by the dashboard at app.autousers.ai. Set automatically by Supabase Auth on sign-in. There is nothing for an integrator to do here.

Path 2 — API key (ak_live_*)

The right choice for server-to-server, CI/CD, the CLI, and the MCP server. Mint at Settings → API keys; you’ll see the plaintext value once.
Properties:
  • Prefixed ak_live_; sha256-hashed at rest (never stored plaintext).
  • Bound to the team it was minted on. All requests act on that team.
  • Scopes are explicit and immutable for the life of the key. To change scopes, mint a new key and revoke the old one.
  • Optional expiry; default is no expiry.
  • Last-used IP and timestamp are recorded for audit.

Path 3 — OAuth 2.1 access token

Audience-bound HS256 JWT minted by /api/oauth/token after a user authorizes a third-party MCP app or SDK. Tokens are short-lived (≤15 minutes) and must carry an aud claim matching the resource server they are presented to (RFC 8707). A token minted for /mcp will not verify at /api/v1/*, and vice versa.
Token payload:
Access tokens are stateless. Revoking the underlying refresh token stops future refreshes but does not invalidate access tokens already in flight; they expire naturally at their TTL. This is the standard OAuth 2.1 trade-off.

Path 4 — Figma plugin JWT

Issued by /api/auth/figma/* for the Autousers Figma plugin only. Stored in figma.clientStorage. 7-day expiry. HS256, signed with a secret distinct from the OAuth signing key — Figma JWTs cannot be replayed as OAuth tokens or vice versa. You will not need this unless you are forking the Figma plugin.

Scopes

Scopes are resource:action strings. Use the wildcard sparingly.
When webhooks ship (see Changelog) three more scopes are added: webhooks:read, webhooks:write, events:read.
The literal scope is checked first, then the family wildcard (evaluations:*), then the admin wildcard (*).

Key rotation

Mint a new key with the same scopes, deploy it, then revoke the old key.
/api/v1/api-keys/* is session-only. You cannot mint or revoke keys with another ak_live_* key — that prevents a leaked key from bootstrapping itself into permanence. Use the dashboard or a session cookie.

Best practices

  • Mint a separate key per environment (CI, staging, prod). Revoke blast radius is the key, not the account.
  • Use the narrowest scope that works. Reach for evaluations:read before evaluations:*, and * only for break-glass admin tooling.
  • Rotate keys annually or when an employee with key access leaves.
  • Set an expiry on keys you only need for a known window (a launch, a contractor engagement).
  • Never log the Authorization header. Never paste a key into a chat transcript or a screenshot.