📱 Mobile API Documentation
RESTful API for iOS, Android, and React Native applications
🚀 Quick Start
Base URL: /api/mobile/v1
🔐 Authentication
1. Login
/auth/login
{
"email": "user@example.com",
"password": "secure_password",
"device_id": "uuid-device-identifier"
}
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 3600,
"user": {
"id": 123,
"email": "user@example.com"
}
}
2. Use Access Token
Include the access token in the Authorization header for all protected endpoints:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
3. Refresh Token
Access tokens expire after 1 hour. Use the refresh token to get a new access token:
/auth/refresh
{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
📋 API Endpoints
/health
Check API availability and response times. No authentication required.
{
"status": "healthy",
"timestamp": "2025-11-06T12:00:00Z",
"version": "1.0.0",
"response_time_ms": 12
}
/mti
🔒 Auth RequiredGet current Money Tide Index, regime classification, and market signals.
?fields=mti,sni,regime - Filter response fields
?format=compact - Minimal response (<5KB)
{
"mti": 1.23,
"sni": 0.85,
"regime": "Tailwind",
"velocity": 0.15,
"acceleration": 0.03,
"confidence": 0.87,
"last_updated": "2025-11-06T12:00:00Z",
"cache_expires": 300
}
/allocation
🔒 Auth RequiredGet recommended budget allocation across 8 marketing channels based on current MTI.
?budget=100000 - Total budget (default: $100,000)
?risk_posture=balanced - conservative/balanced/aggressive
{
"regime": "Tailwind",
"total_budget": 100000,
"allocation": {
"paid_search": 18500,
"paid_social": 16200,
"display": 12300,
"video": 10800,
"seo": 15400,
"email": 11600,
"content": 9700,
"events": 5500
},
"confidence": 0.87
}
/dashboard
🔒 Auth RequiredGet complete dashboard data (MTI + allocation + history) in a single optimized response.
?format=compact to reduce response size by 60% for mobile networks
/history
🔒 Auth RequiredGet historical MTI/SNI data for charting. Returns up to 90 days of daily data points.
?days=30 - Number of days (default: 30, max: 90)
?granularity=daily - daily/weekly/monthly
/devices/register
🔒 Auth RequiredRegister device for push notifications and offline sync.
{
"device_token": "fcm-or-apns-token",
"platform": "ios", // "ios" or "android"
"device_info": {
"model": "iPhone 15 Pro",
"os_version": "17.1",
"app_version": "1.2.0"
}
}
/sync
🔒 Auth RequiredDelta sync for offline-first apps. Only returns data changed since last sync timestamp.
{
"last_sync": "2025-11-06T10:00:00Z",
"resources": ["mti", "allocations"]
}
⚡ Rate Limiting
Rate limits are enforced per device and included in response headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1699275600