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
Array of chat session objects
string
Unique session identifier (UUID)
string
Session title (auto-generated from first message or custom)
string
ISO 8601 timestamp of session creation
string
ISO 8601 timestamp of last update
number
Number of messages in the session
object
UI preferences for the session (model, mode, providers)
string
Session status:
active, completed, or cancelledPOST /chat_api/sessions
Create a new chat session. Authentication: Required (X-User-ID header) Request Body:string
Custom session title. If not provided, auto-generated from first message (max 50 chars)
array
default:"[]"
Initial messages for the session (usually empty for new sessions)
object
default:"{}"
UI state including model, mode, and provider preferences
string
Unique session identifier
string
Session title
array
Session messages
object
UI state object
string
ISO 8601 creation timestamp
string
ISO 8601 update timestamp
string
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:string
required
UUID of the session to retrieve
array
PUT /chat_api/sessions/:session_id
Update an existing chat session. Authentication: Required (X-User-ID header) Parameters:string
required
UUID of the session to update
string
Updated session title
array
Updated messages array
object
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:string
required
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:string
Session ID to preserve from deletion
Error Responses
string
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