Convenient endpoint to add a message to a chat using API key authentication. MessageIndex is auto-calculated. Requires CHAT scope.
Enter your LeanMCP API key
Chat ID
"c1a83d84-7154-464c-bd19-a9f10e0a067f"
Role of the message sender
system, assistant, user "user"
Content of the message
"Hello, can you help me with my project?"
Optional metadata as key-value pairs
{ "model": "claude-3-sonnet", "tokens": 150 }Array of file IDs to associate with this message
[
"f1a83d84-7154-464c-bd19-a9f10e0a067f",
"f2b94e95-8265-575d-ce2a-b0f21f1b178g"
]Message added to chat successfully
Unique message identifier (UUID)
Chat ID this message belongs to (UUID)
"c1a83d84-7154-464c-bd19-a9f10e0a067f"
User ID who owns this message
Role of the message sender
system, assistant, user Message content/text
Order of message in the chat (0-based)
x >= 0Timestamp when message was created
Timestamp when message was last updated
Additional metadata for the message