Auth Service
API Contract
REST
/api/v1/auth
5 endpoints
GET
/api/v1/auth/api/v1/auth
List all active auth sessions for the authenticated user with pagination.
Public
Response Example
{
"data": [
{
"session_id": "sess_9f2a3b4c5d6e7f8a",
"user_id": "user_1a2b3c4d-e5f6-7890-abcd-ef1234567890",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzFhMmIzYzRkIiwiZXhwIjoxNzQzMDIwNjAwfQ.mK9pQ2rS1tU3vW4xY5zA6bC7dE8fG9h",
"token_type": "Bearer",
"expires_at": "2026-03-26T18:30:00.000Z",
"created_at": "2026-03-26T14:22:40.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/auth/api/v1/auth/:id
Get a specific auth session by session ID. Maps to getCurrentSession().
Public
Response Example
{
"session_id": "sess_9f2a3b4c5d6e7f8a",
"user_id": "user_1a2b3c4d-e5f6-7890-abcd-ef1234567890",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzFhMmIzYzRkIiwiZXhwIjoxNzQzMDIwNjAwfQ.mK9pQ2rS1tU3vW4xY5zA6bC7dE8fG9h",
"refresh_token": "v1.Mfqd8QJK3xnR2pL7sT9wZ0cE5aB6yN4hP1qD",
"token_type": "Bearer",
"expires_at": "2026-03-26T18:30:00.000Z",
"user": {
"id": "user_1a2b3c4d-e5f6-7890-abcd-ef1234567890",
"email": "john.doe@example.com",
"email_confirmed_at": "2026-01-15T10:00:00.000Z",
"created_at": "2026-01-15T09:55:00.000Z"
},
"created_at": "2026-03-26T14:22:40.000Z"
}
POST
/api/v1/auth/api/v1/auth
Sign in with email and password (signInWithEmailPassword). Returns AuthResult with session on success.
Public
Request Example
{
"email": "john.doe@example.com",
"password": "SecurePass@2026!"
}
Response Example
{
"success": true,
"session": {
"session_id": "sess_9f2a3b4c5d6e7f8a",
"user_id": "user_1a2b3c4d-e5f6-7890-abcd-ef1234567890",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzFhMmIzYzRkIiwiZXhwIjoxNzQzMDIwNjAwfQ.mK9pQ2rS1tU3vW4xY5zA6bC7dE8fG9h",
"refresh_token": "v1.Mfqd8QJK3xnR2pL7sT9wZ0cE5aB6yN4hP1qD",
"token_type": "Bearer",
"expires_at": "2026-03-26T18:30:00.000Z",
"expires_in": 3600
},
"user": {
"id": "user_1a2b3c4d-e5f6-7890-abcd-ef1234567890",
"email": "john.doe@example.com",
"email_confirmed_at": "2026-01-15T10:00:00.000Z",
"created_at": "2026-01-15T09:55:00.000Z"
},
"error": null,
"created_at": "2026-03-26T14:22:40.000Z"
}
PUT
/api/v1/auth/api/v1/auth/:id
Refresh an existing session by session ID (refreshSession). Returns a new AuthResult with updated tokens.
Public
Request Example
{
"refresh_token": "v1.Mfqd8QJK3xnR2pL7sT9wZ0cE5aB6yN4hP1qD"
}
Response Example
{
"success": true,
"session": {
"session_id": "sess_9f2a3b4c5d6e7f8a",
"user_id": "user_1a2b3c4d-e5f6-7890-abcd-ef1234567890",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzFhMmIzYzRkIiwiZXhwIjoxNzQzMDI0MjAwfQ.nL0qR3sT2uV4wX5yZ6aB7cD8eF9gH0iJ",
"refresh_token": "v1.Ngrp9RLM4yoS3qM8tU0xA1dF6bC7zO5iQ2rE",
"token_type": "Bearer",
"expires_at": "2026-03-26T19:30:00.000Z",
"expires_in": 3600
},
"error": null,
"updated_at": "2026-03-26T15:30:00.000Z"
}
DELETE
/api/v1/auth/api/v1/auth/:id
Sign out and invalidate a session by session ID (signOut). Clears server-side session.
Public
Response Example
{
"success": true,
"signed_out": true,
"session_id": "sess_9f2a3b4c5d6e7f8a"
}