cURL
curl --request POST \ --url https://api.leanmcp.com/api/chat-messages/chat/id/{chatId}/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "messages": [ { "role": "user", "content": "Hello, can you help me with my project?", "metadata": { "model": "claude-3-sonnet", "tokens": 150 }, "fileIds": [ "f1a83d84-7154-464c-bd19-a9f10e0a067f", "f2b94e95-8265-575d-ce2a-b0f21f1b178g" ] } ] } '
{ "messages": [ { "id": "<string>", "chatId": "c1a83d84-7154-464c-bd19-a9f10e0a067f", "userId": "<string>", "role": "system", "content": "<string>", "messageIndex": 1, "createdAt": "<string>", "updatedAt": "<string>", "metadata": {} } ], "count": 123, "chatId": "c1a83d84-7154-464c-bd19-a9f10e0a067f" }
Bulk insert multiple messages into a chat using API key authentication. MessageIndex values are auto-calculated sequentially. Requires CHAT scope.
Enter your LeanMCP API key
Chat ID
"c1a83d84-7154-464c-bd19-a9f10e0a067f"
Array of messages to create
Show child attributes
Messages added to chat successfully
Created messages
Number of messages created
Chat ID where messages were added