Chat Sessions
Chat sessions store conversation history and state for Aurora’s AI agent. Each session maintains messages, UI state, and metadata.Endpoints
GET /chat_api/sessions
Retrieve all chat sessions for the authenticated user. Authentication: Required (X-User-ID header) Response:Array of chat session objects
Unique session identifier (UUID)
Session title (auto-generated from first message or custom)
ISO 8601 timestamp of session creation
ISO 8601 timestamp of last update
Number of messages in the session
UI preferences for the session (model, mode, providers)
Session status:
active, completed, or cancelledPOST /chat_api/sessions
Create a new chat session. Authentication: Required (X-User-ID header) Request Body:Custom session title. If not provided, auto-generated from first message (max 50 chars)
Initial messages for the session (usually empty for new sessions)
UI state including model, mode, and provider preferences
Unique session identifier
Session title
Session messages
UI state object
ISO 8601 creation timestamp
ISO 8601 update timestamp
Session status (always “active” for new sessions)
GET /chat_api/sessions/:session_id
Retrieve a specific chat session with full message history. Authentication: Required (X-User-ID header) Parameters:UUID of the session to retrieve
Full array of message objects
Message sender:
user or assistantMessage text content
PUT /chat_api/sessions/:session_id
Update an existing chat session. Authentication: Required (X-User-ID header) Parameters:UUID of the session to update
Updated session title
Updated messages array
Updated UI state
- Only provided fields are updated
- Cannot update
cancelledorcompletedsessions - Title auto-generates from messages if not provided and current title is “New Chat”
updated_atis automatically set to current timestamp
DELETE /chat_api/sessions/:session_id
Delete a chat session (soft delete). Authentication: Required (X-User-ID header) Parameters:UUID of the session to delete
- Sessions are soft-deleted (marked as inactive, not removed from database)
- Associated storage files (Terraform state, etc.) are also deleted
- Deleted sessions cannot be recovered
DELETE /chat_api/sessions/bulk-delete
Delete all chat sessions for a user, optionally preserving the current session. Authentication: Required (X-User-ID header) Query Parameters:Session ID to preserve from deletion
Error Responses
Error message describing what went wrong
401 Unauthorized- Missing or invalid authentication403 Forbidden- Cannot update cancelled/completed session404 Not Found- Session not found500 Internal Server Error- Server error
Session Lifecycle
- Created - New session with
status: "active" - Updated - Messages added/modified via PUT requests
- Completed - Agent workflow finishes successfully
- Cancelled - User cancels ongoing workflow
- Deleted - Soft-deleted by user (marked inactive)
Best Practices
- Always check
statusbefore updating sessions - Use
bulk-deletewithcurrent_session_idto clear history while preserving active chat - Store
session_idon the client to maintain conversation continuity - Title auto-generation uses first 50 characters of first user message
- Sessions automatically update
updated_aton any modification