Endpoint
Overview
Retrieve the chat conversation history for a specific user and optional session.
Request
Unique identifier for the user
Optional session ID to filter by specific conversation
Maximum number of messages to return (default: 50, max: 100)
curl "http://localhost:18080/api/history?user_id=user_123&session_id=session_abc&limit=20"
Response
{
"history": [
{
"role": "user",
"content": "How many steps did I take yesterday?",
"timestamp": "2024-01-15T10:30:00Z"
},
{
"role": "assistant",
"content": "Based on your Garmin data, you took 10,543 steps yesterday.",
"timestamp": "2024-01-15T10:30:02Z"
}
],
"session_id": "session_abc",
"total_messages": 2
}