Skip to main content

Overview

Conformly.ai uses Supabase JWT tokens for authentication. All API requests require a valid token in the Authorization header.

Base URL

https://your-api-domain.com/api/v1

Authentication Header

Authorization: Bearer <supabase_jwt_token>

Endpoints

Get Current User Profile

none
curl -X GET "https://api.conformly.ai/api/v1/auth/me" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "email": "[email protected]",
  "name": "John Doe",
  "organization": "Acme Corp",
  "role": "engineer",
  "created_at": "2024-01-15T10:30:00Z",
  "last_login": "2024-01-15T10:30:00Z"
}

Refresh JWT Token

curl -X POST "https://api.conformly.ai/api/v1/auth/refresh" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
{
  "access_token": "new_jwt_token",
  "expires_in": 3600
}

Error Responses

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired token",
    "details": {},
    "timestamp": "2024-01-15T10:30:00Z",
    "request_id": "req_123456789"
  }
}

Frontend Integration

// Get user profile
const getUserProfile = async (token) => {
  const response = await fetch('/api/v1/auth/me', {
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    }
  });
  
  if (!response.ok) {
    throw new Error('Failed to get user profile');
  }
  
  return await response.json();
};