Skip to main content

Base URL

http://localhost:3002/api/v1

Authentication

Phone-based authentication with OTP verification.
# Step 1: Sign in with phone
curl -X POST http://localhost:3002/api/v1/auth/signin \
  -H "Content-Type: application/json" \
  -d '{"phoneNumber":"+1234567890"}'

# Step 2: Create OTP (use accessToken from step 1)
curl -X POST http://localhost:3002/api/v1/auth/otp/create \
  -H "Authorization: Bearer ACCESS_TOKEN"

# Step 3: Validate OTP
curl -X POST http://localhost:3002/api/v1/auth/otp/validate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -d '{"otp":"123456"}'

Response Format

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

Features

  • Phone-based authentication
  • OTP verification (SMS)
  • User profile management
  • Bearer token auth
  • Mobile-optimized responses

Mobile Integration

React Native

const apiClient = axios.create({
  baseURL: 'http://localhost:3002/api/v1',
  headers: { 'Content-Type': 'application/json' }
});

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

Next Steps