Skip to main content
GET
/
api
/
chats
/
id
/
{id}
/
history
/
raw
Get chat history (raw messages only) via API key
curl --request GET \
  --url https://api.leanmcp.com/api/chats/id/{id}/history/raw \
  --header 'Authorization: Bearer <token>'
{
  "chat": {
    "id": "<string>",
    "userId": "<string>",
    "title": "<string>",
    "isPublic": false,
    "status": "active",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "messageCount": 1,
    "showcased": false,
    "summary": "<string>",
    "modelUsed": "<string>",
    "systemMessageId": "<string>",
    "metadata": {}
  },
  "messageIds": [
    "<string>"
  ],
  "totalMessages": 123,
  "retrievedAt": "<string>"
}

Authorizations

Authorization
string
header
required

Enter your LeanMCP API key

Path Parameters

id
string
required

Chat ID

Example:

"c1a83d84-7154-464c-bd19-a9f10e0a067f"

Response

Chat history retrieved successfully

chat
object
required

Chat metadata

messageIds
string[]
required

Array of message IDs in chronological order

totalMessages
number
required

Total number of messages in chat

retrievedAt
string
required

Timestamp when history was retrieved