Overview
Loom supports multiple authentication flows:- OAuth 2.0: GitHub, Google, and Okta (enterprise)
- Magic Links: Passwordless email authentication
- Device Code Flow: CLI and VS Code authentication
- Session Cookies: Web browser sessions
- API Keys: Programmatic access with scoped permissions
Get Available Providers
Response
Array of provider names (e.g.,
["github", "google", "magic_link"])Example
Get Current User
Response
User ID (UUID)
User’s display name
Username (if set)
Primary email address
Profile avatar URL
Preferred locale (e.g.,
"en", "es", "ar")Array of global role names (e.g.,
["system_admin", "support"])ISO 8601 timestamp of account creation
Example
Get WebSocket Token
Response
WebSocket token (prefix:
ws_). Valid for 30 seconds, single-use.Token lifetime in seconds (30)
Example
Logout
Response
Success message
Example
OAuth Login (GitHub)
Query Parameters
URL to redirect after successful login (default:
/)Example
/auth/callback/github after authorization.
OAuth Callback (GitHub)
redirect_uri.
Query Parameters
OAuth authorization code from GitHub
CSRF token from initial login request
Error code if authorization failed
Human-readable error description
Example
loom_session cookie and redirects to original redirect_uri.
Magic Link Request
Request Body
Email address to send magic link to
Response
Success message
Example
https://loom.ghuntley.com/auth/magic-link/verify?token=...
Magic Link Verify
Query Parameters
Magic link token from email
URL to redirect after login (default:
/)Example
loom_session cookie and redirects to /dashboard.
Device Code Flow (CLI)
The device code flow enables CLI and VS Code authentication without opening a browser on the same machine.Step 1: Start Device Code Flow
Response
Device code for polling (opaque token)
Short code to display to user (e.g.,
"ABCD-1234")URL where user enters the code (e.g.,
"https://loom.ghuntley.com/device")Expiry time in seconds (default: 600)
Example
Step 2: Poll for Completion
pending until user completes authorization.
Request Body
Device code from
/auth/device/startResponse (Pending)
Response (Completed)
Response (Expired)
Example
completed or expired.
Step 3: User Completes Authorization
User visitshttps://loom.ghuntley.com/device, enters the user code, and authorizes:
Request Body
User code displayed by CLI (e.g.,
"ABCD-1234")Response
Error Responses
All auth endpoints return errors in this format:unauthorized: Authentication requiredinvalid_token: Token is invalid or expiredprovider_not_configured: OAuth provider not enabledemail_send_failed: Failed to send magic link email