Skip to main content

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:
  1. Header-based authentication (Recommended)
  2. 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:
Response (201):
Validation:
  • 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:
Response (200):
Security Features:
  • 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:
Request Body:
Response (200):

Chat Sessions

GET /chat_api/sessions

Retrieve all chat sessions for the authenticated user. Headers:
Response (200):

POST /chat_api/sessions

Create a new chat session. Request Body:
Response (201):

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:
Allowed Values:
  • 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
Request Body:
Response (202):

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:
Response:

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
Rate Limit Headers:

Error Responses

Standard Error Format

Common HTTP Status Codes

  • 200 OK: Successful request
  • 201 Created: Resource created successfully
  • 202 Accepted: Request accepted for async processing
  • 400 Bad Request: Invalid request format or parameters
  • 401 Unauthorized: Authentication required
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Resource not found
  • 409 Conflict: Resource already exists
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server error
  • 503 Service Unavailable: Service temporarily unavailable

CORS Configuration

Aurora is configured with CORS support for cross-origin requests: Allowed Origins:
  • Configured via FRONTEND_URL environment variable
  • Credentials supported: true
Allowed Methods:
  • GET, POST, PUT, DELETE, OPTIONS, PATCH
Allowed Headers:
  • Content-Type, X-Provider, X-Requested-With, X-User-ID, Authorization, X-Provider-Preference

API Versioning

Currently, Aurora API does not use explicit versioning. Breaking changes are avoided, and new features are added in a backward-compatible manner.

Code Examples

Python

JavaScript/TypeScript

cURL