Skip to content

Authentication

All API requests to TheWARDN require authentication via a Bearer token.

Base URL

https://api.thewardn.ai

Authentication Methods

API Key (Bearer Token)

Include your API key in the Authorization header:

bash
curl -H "Authorization: Bearer wdn_live_YOUR_KEY_HERE" \
  https://api.thewardn.ai/health

Session Token (Console)

The console uses Supabase Auth for session-based authentication. After login, a JWT access token is stored and sent with each request. Token refresh is handled automatically.

Getting Your API Key

  1. Log in to console.thewardn.ai
  2. Navigate to Settings
  3. Find your API key in the API Configuration section
  4. Click Copy to copy it to clipboard

Security

  • Never expose your API key in client-side code
  • Use environment variables or secrets managers
  • Rotate your key immediately if compromised (Settings > Regenerate Key)

Authentication Endpoints

Login

POST /auth/login

Authenticate with email and password. Returns JWT tokens.

Request:

json
{
  "email": "user@example.com",
  "password": "your-password"
}

Response:

json
{
  "access_token": "eyJ...",
  "refresh_token": "abc...",
  "user": {
    "id": "usr_...",
    "email": "user@example.com",
    "role": "ARCHITECT"
  },
  "tenant": {
    "id": "tnt_...",
    "name": "My Organization",
    "tier": "business"
  }
}

Signup

POST /auth/signup

Create a new account.

Request:

json
{
  "email": "user@example.com",
  "password": "secure-password-here",
  "org_name": "My Organization"
}

Refresh Token

POST /auth/refresh

Refresh an expired access token.

Request:

json
{
  "refresh_token": "abc..."
}

Logout

POST /auth/logout

Invalidate the current session.

Reset Password

POST /auth/reset-password

Send a password reset email.

Request:

json
{
  "email": "user@example.com"
}

Rate Limits

EndpointLimit
Auth endpoints10 requests/minute
API endpointsBased on tier (see below)
TierBurst RatePer-MinutePer-Hour
Free5/sec30/min100/hr
Startup10/sec60/min1,000/hr
Business20/sec120/min5,000/hr
EnterpriseCustomCustomCustom

Error Responses

All errors follow a consistent format:

json
{
  "detail": "Human-readable error message"
}
Status CodeMeaning
401Missing or invalid Authorization header
403Insufficient permissions (wrong role or tier)
404Resource not found
422Validation error (check request body)
429Rate limit exceeded
500Internal server error

Health Check

GET /health

No authentication required. Returns gateway status.

json
{
  "status": "ok",
  "service": "wardn-gateway",
  "version": "1.0.0",
  "timestamp": "2026-04-10T20:14:39Z",
  "checks": {
    "gateway": "ok",
    "database": "ok"
  }
}

AI Governance for Every Organization