Skip to main content
PATCH
/
api
/
chats
/
id
/
{id}
Update chat metadata via API key
curl --request PATCH \
  --url https://api.leanmcp.com/api/chats/id/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "My Updated Chat Title",
  "summary": "Discussion about TypeScript best practices",
  "modelUsed": "claude-3-sonnet",
  "systemMessageId": "msg_uuid_system_001",
  "metadata": {
    "category": "development",
    "priority": "high"
  }
}
'
{
  "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

Path Parameters

id
string
required

Chat ID

Example:

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

Body

application/json
title
string

Updated chat title

Example:

"My Updated Chat Title"

summary
string

Updated chat summary

Example:

"Discussion about TypeScript best practices"

modelUsed
string

Model used in this chat

Example:

"claude-3-sonnet"

systemMessageId
string

System message ID reference

Example:

"msg_uuid_system_001"

metadata
object

Additional metadata

Example:
{
"category": "development",
"priority": "high"
}

Response

Chat updated 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