API Overview
Tracera exposes a RESTful API under/api/v1 and a WebSocket endpoint for real-time updates.
Base URL
BASE_URL.
Authentication
Most endpoints are public. Authenticated endpoints require a valid session cookie (set during login). The session is managed server-side in Redis. To check authentication status:CSRF Protection
State-changing endpoints (POST, PUT, DELETE) on authenticated routes require a CSRF token:
-
Fetch the token:
-
Include it in subsequent requests:
Rate Limiting
Authentication endpoints are rate-limited to 20 requests per minute per IP address.Response Format
All API responses use JSON. Successful responses return the resource directly. Error responses follow this format:Endpoint Groups
| Group | Base Path | Auth Required | Status | Description |
|---|---|---|---|---|
| Health | /api/v1/health | No | ✅ Live | Service health status |
| Auth | /api/v1/auth/* | Varies | ✅ Live | Authentication and session management |
| Items | /api/v1/items/* | No | 🔜 Planned | Item metadata, prices, and volatility |
| Portfolio | /api/v1/portfolio/* | Yes | 🔜 Planned | Portfolio management and valuation |
| WebSocket | /api/v1/ws | No | 🔜 Planned | Real-time price and volatility updates |