API Architecture
Aurora provides a comprehensive REST API built with Flask, organized into domain-specific blueprints. All endpoints are accessible via the main server running on port 5080.Base URL
Authentication
All API requests require authentication via one of these methods:-
Header-based authentication (Recommended)
-
Session-based authentication
- Uses Flask session cookies
- Set via Auth.js authentication flow
Core Endpoints
Authentication
POST /api/auth/register
Register a new user with email and password. Request Body:- Password must be at least 8 characters
- Email must be unique
- Password is hashed using bcrypt
POST /api/auth/login
Authenticate with email and password. Request Body:- Constant-time password comparison to prevent timing attacks
- bcrypt password hashing with salt
- Failed login attempts logged
POST /api/auth/change-password
Change user password (requires authentication). Headers:Chat Sessions
GET /chat_api/sessions
Retrieve all chat sessions for the authenticated user. Headers:POST /chat_api/sessions
Create a new chat session. Request Body:GET /chat_api/sessions/:session_id
Get a specific chat session with full message history. Response (200):PUT /chat_api/sessions/:session_id
Update a chat session. Request Body:DELETE /chat_api/sessions/:session_id
Soft delete a chat session. Response (200):Incidents (RCA)
GET /api/incidents
Get all incidents for the current user. Response (200):GET /api/incidents/:incident_id
Get detailed information about a specific incident. Response (200):PATCH /api/incidents/:incident_id
Update incident status or properties. Request Body:status: “investigating”, “analyzed”, “merged”, “resolved”auroraStatus: “idle”, “running”, “complete”, “error”activeTab: “thoughts”, “chat”
POST /api/incidents/:incident_id/chat
Ask a question about an incident (creates background chat task). Query Parameters:session_id(optional): Continue existing chat session
Health Checks
GET /health
Comprehensive health check for all services. Response (200 or 503):GET /health/liveness
Kubernetes liveness probe. Response (200):GET /health/readiness
Kubernetes readiness probe. Response (200 or 503):Cloud Provider Endpoints
GCP
POST /login
Initiate GCP OAuth flow. Request Body:GET /callback
Handle OAuth callback from Google.POST /api/gcp/force-disconnect
Disconnect GCP account and clear credentials.AWS, Azure, and Other Providers
Similar patterns apply for other cloud providers with provider-specific authentication flows.Rate Limiting
Aurora implements rate limiting to protect against abuse:- Default rate: 100 requests per minute per user
- Chat endpoints: 20 requests per minute
- Health endpoints: Exempt from rate limiting
Error Responses
Standard Error Format
Common HTTP Status Codes
200 OK: Successful request201 Created: Resource created successfully202 Accepted: Request accepted for async processing400 Bad Request: Invalid request format or parameters401 Unauthorized: Authentication required403 Forbidden: Insufficient permissions404 Not Found: Resource not found409 Conflict: Resource already exists429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server error503 Service Unavailable: Service temporarily unavailable
CORS Configuration
Aurora is configured with CORS support for cross-origin requests: Allowed Origins:- Configured via
FRONTEND_URLenvironment variable - Credentials supported:
true
- GET, POST, PUT, DELETE, OPTIONS, PATCH
- Content-Type, X-Provider, X-Requested-With, X-User-ID, Authorization, X-Provider-Preference