API-GET-v1-chat-history-id

abstract

Returns the full message history for a session, ordered by created_at ascending. Called by ChatInterface when currentSessionId changes to restore conversation context.


🔒 Authentication

None.


🛠️ Technical Specification

Request

PropertyValue
MethodGET
Path/api/v1/chat/history/{session_id}
Tags["Chat"]

📦 Path Parameters

ParamTypeRequiredDescription
session_idUUIDYesSession whose messages to load

Logic Flow

📤 Responses

StatusBodyCondition
200 OK{ session: ChatSession, messages: ChatMessage[] }Session found
404 Not Found{ detail: "Session not found" }Invalid session_id

Each ChatMessage includes: id, session_id, role, content, provider, model, sources, detected_mode, created_at.

RoleFile
Routerbackend/app/api/v1/chat.py :: get_chat_history()
DB modelsbackend/app/models/chat.py :: ChatSession, ChatMessage
UI consumerfrontend/src/components/chat/chat-interface.tsx

RoleLink
Create message (streaming)API-GET-v1-chat-ask-stream
DB message tableDB - chatmessage
DB session tableDB - chatsession