Skip to main content
GET
/
api
/
chats
Get all user chats via API key
curl --request GET \
  --url https://api.leanmcp.com/api/chats \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "c1a83d84-7154-464c-bd19-a9f10e0a067f",
    "title": "Help with TypeScript",
    "messageCount": 8,
    "createdAt": "2025-06-16T19:30:00.000Z",
    "lastMessageAt": "2025-06-16T20:15:00.000Z",
    "modelUsed": "claude-3-sonnet",
    "summary": "Discussion about TypeScript best practices",
    "metadata": "Discussion about TypeScript best practices"
  }
]

Authorizations

Authorization
string
header
required

Enter your LeanMCP API key

Response

200 - application/json

Chat list retrieved successfully

id
string
required

Chat unique identifier

Example:

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

title
string
required

Chat title

Example:

"Help with TypeScript"

messageCount
number
required

Number of messages in the chat

Example:

8

createdAt
string
required

When the chat was created

Example:

"2025-06-16T19:30:00.000Z"

lastMessageAt
string

Timestamp of the last message

Example:

"2025-06-16T20:15:00.000Z"

modelUsed
string

Model used in this chat

Example:

"claude-3-sonnet"

summary
string

Chat summary

Example:

"Discussion about TypeScript best practices"

metadata
object

Chat metadata

Example:

"Discussion about TypeScript best practices"