Skip to main content
The auth endpoints handle user login, registration, and retrieving the authenticated user’s profile. The POST /api/login endpoint is used by the CLI and any application that needs to exchange credentials for a JWT. Base path: /api/v1/auth

GET /auth/me — get current user

Returns the profile of the authenticated user.
GET /api/v1/auth/me
Authorization: Bearer <token>

Response

{
  "id": 1,
  "supabase_id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "user@example.com",
  "role": "user",
  "plan": "starter",
  "created_at": "2024-01-15T10:00:00Z"
}
id
integer
Internal user ID.
supabase_id
string
The user’s UUID in Supabase Auth.
email
string
The user’s email address.
role
string
Account role: user or admin.
plan
string
Subscription plan: community, starter, professional, or enterprise.

POST /login — sign in and get token

Signs in with email and password, and returns a JWT. Used by the CLI’s auth login command and non-Supabase client integrations.
POST /api/login
Content-Type: application/json

Request body

email
string
required
The user’s email address.
password
string
required
The user’s password.
Example:
{
  "email": "user@example.com",
  "password": "your-password"
}

Response

{
  "user": {
    "id": 1,
    "email": "user@example.com",
    "role": "user"
  },
  "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9..."
}

POST /register — create an account

Creates a new user account and returns the same response as login.
POST /api/register
Content-Type: application/json

Request body

email
string
required
Email address for the new account.
password
string
required
Password for the new account.
Example:
{
  "email": "newuser@example.com",
  "password": "your-password"
}

Response

Same structure as POST /login.
For refreshing an expired session token, use the Supabase client’s refreshSession() method. The InfraAudit API does not expose a dedicated refresh endpoint.