Skip to main content

Authentication

Authentication endpoints handle user account management, session tokens, and OAuth flows. Most endpoints in this group do not require authentication, as they are used to establish credentials.

Authentication Methods

MethodDescription
Email/PasswordRegister with email and password, verify email, then log in to receive a JWT token
Google OAuthSign in using a Google account
GitHub OAuthSign in using a GitHub account

Endpoints

Account Management

MethodEndpointDescription
POST/auth/create_userRegister a new user account
POST/auth/loginLog in and receive a JWT token
POST/auth/verify_userVerify email address
POST/auth/resend_verificationResend verification email
GET/auth/fetch_userGet current user profile
GET/auth/fetch_user_quotaGet usage quota and limits

OAuth

MethodEndpointDescription
GET/auth/oauth/googleGet Google OAuth authorization URL
POST/auth/oauth/google/callbackHandle Google OAuth callback
GET/auth/oauth/githubGet GitHub OAuth authorization URL
POST/auth/oauth/github/callbackHandle GitHub OAuth callback

OAuth Flow

OAuth authentication follows a two-step process:
  1. Get Authorization URL — Call the provider’s authorization endpoint to receive a redirect URL
  2. Handle Callback — After the user authorizes with the provider, send the authorization code to the callback endpoint to receive a JWT token
OAuth users don’t need to verify their email separately. If a user with the same email already exists (registered via email/password), the accounts are linked.

Token Lifecycle

  1. Register an account or sign in via OAuth
  2. Verify your email (email/password only)
  3. Log in to receive a JWT token
  4. Include the token in subsequent API requests via the Authorization: Bearer <token> header
  5. Tokens expire after 24 hours — log in again to obtain a new one
For API key-based authentication (no expiry), see Platform API Keys.