Skip to main content

Base URL

http://localhost:3002/api/v1

Authentication

All protected endpoints require Bearer token:
fetch('/api/v1/users/current', {
  headers: {
    'Authorization': `Bearer ${sessionToken}`
  }
});

Response Format

Success:
{
  "success": true,
  "data": { ... }
}
Error:
{
  "success": false,
  "error": {
    "message": "Error description",
    "code": "ERROR_CODE"
  }
}

Phone Number Format

International format (E.164):
+1234567890

Error Codes

  • VALIDATION_ERROR: Invalid input
  • NOT_FOUND: Resource not found
  • UNAUTHORIZED: Invalid/expired token
  • OTP_EXPIRED: OTP has expired
  • RATE_LIMITED: Too many requests

Mobile Integration

React Native

const apiClient = axios.create({
  baseURL: 'http://localhost:3002/api/v1'
});

apiClient.interceptors.request.use(async (config) => {
  const token = await AsyncStorage.getItem('sessionToken');
  if (token) config.headers.Authorization = `Bearer ${token}`;
  return config;
});

Flutter

final token = await SecureStorage.read('sessionToken');
final headers = {
  'Content-Type': 'application/json',
  if (token != null) 'Authorization': 'Bearer $token',
};