Authentication Reference
All authentication endpoints. For the conceptual overview, see Authentication.
Base path: /v1/auth/
POST /v1/auth/identify#
Identify a user by email and return the tenants they can sign into.
1 2 3 | |
Response:
1 2 3 4 5 6 7 8 9 10 | |
If the user has access to multiple tenants, they pick one for the subsequent authorize call. No authentication required on this endpoint.
POST /v1/auth/authorize#
Begin an OAuth 2.0 authorization code flow with PKCE.
1 2 3 4 5 6 7 8 9 10 | |
Response includes a URL to ScaiKey where the user completes SSO:
1 2 3 4 5 6 | |
GET /v1/auth/callback#
OAuth callback handler. ScaiKey redirects here with an authorization code. Exchanges for tokens and redirects to the caller's redirect_uri.
Usually called by a user's browser after SSO, not directly by application code.
POST /v1/auth/token#
Exchange an authorization code for access + refresh tokens.
1 2 3 4 5 6 7 8 | |
Response:
1 2 3 4 5 6 7 8 9 | |
POST /v1/auth/refresh#
Exchange a refresh token for a fresh access token.
1 2 3 | |
Response identical to /token. Refresh tokens have their own (longer) lifetime — when they expire, the user must sign in again.
POST /v1/auth/logout#
Revoke the current session.
1 2 | |
Returns 204 No Content. Any subsequent request with the same token returns 401 AUTH_TOKEN_INVALID.
GET /v1/auth/me#
Get the current user's profile.
1 2 | |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Equivalent to GET /v1/me.
Error codes#
| Code | Meaning |
|---|---|
AUTH_TOKEN_MISSING |
No Authorization header |
AUTH_TOKEN_INVALID |
Token signature invalid or expired |
AUTH_INSUFFICIENT_SCOPE |
Token lacks a required scope |
AUTH_FLOW_INVALID |
OAuth flow state invalid or expired |
AUTH_IDENTITY_NOT_FOUND |
No account found for email |
SESSION_EXPIRED |
Token expired, refresh required |
See Error Codes for the full list.