Skip to main content
Returns the full conversation history for a chat.
Authorization
string
required
Bearer token obtained from the authenticate endpoint.
chat_id
string
required
Unique identifier of the chat to retrieve.

Response

id
string
required
Unique identifier for the chat.
title
string
required
Display title for the chat.
preview
string
Preview of the first message.
messages
array
required
List of messages in the conversation.
curl -X GET https://api.trellis.sh/v1/chats/chat_abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "id": "chat_abc123",
  "title": "Revenue Analysis",
  "preview": "Show me the monthly revenue trends...",
  "messages": [
    {
      "id": "msg_001",
      "role": "user",
      "content": "Show me the monthly revenue trends for 2025",
      "timestamp": "2025-01-11T14:30:00Z"
    },
    {
      "id": "msg_002",
      "role": "assistant",
      "content": "Here's the monthly revenue breakdown for 2025:\n\n| Month | Revenue |\n|-------|--------|\n| January | $125,000 |\n| February | $142,000 |\n...",
      "timestamp": "2025-01-11T14:30:10Z",
      "metadata": {
        "feedback": "positive"
      }
    }
  ]
}