Skip to main content
POST
/
api
/
chats
Create a new chat via API key
curl --request POST \
  --url https://api.leanmcp.com/api/chats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "isPublic": false,
  "showcased": false,
  "summary": "<string>",
  "modelUsed": "<string>",
  "systemMessageId": "<string>",
  "metadata": {}
}
'
{
  "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": {}
}

Authorizations

Authorization
string
header
required

Enter your LeanMCP API key

Body

application/json
title
string
required

Chat title or subject

isPublic
boolean
default:false

Whether this chat is publicly accessible

showcased
boolean
default:false

Whether this chat is showcased/featured

summary
string

Brief summary of the chat conversation

modelUsed
string

AI model used in this chat (e.g., claude-3-sonnet)

systemMessageId
string

ID of the system message for this chat

metadata
object

Additional metadata for the chat

Response

Chat created successfully

id
string
required

Unique chat identifier (UUID)

userId
string
required

User ID who owns this chat

title
string
required

Chat title or subject

isPublic
boolean
default:false
required

Whether this chat is publicly accessible

status
enum<string>
default:active
required

Current status of the chat

Available options:
active,
archived,
deleted
createdAt
string
required

Timestamp when chat was created

updatedAt
string
required

Timestamp when chat was last updated

messageCount
number
required

Number of messages in this chat

Required range: x >= 0
showcased
boolean
default:false

Whether this chat is showcased/featured

summary
string

Brief summary of the chat conversation

modelUsed
string

AI model used in this chat (e.g., claude-3-sonnet)

systemMessageId
string

ID of the system message for this chat

metadata
object

Additional metadata for the chat