Authentication
All endpoints require JWT authentication via theAuthorization header:
List Messages
Query Parameters
Filter messages by conversation ID
Retrieve a specific message (requires conversationId)
Full-text search query (uses MeiliSearch)
Pagination cursor for next page
Sort field:
endpoint, createdAt, or updatedAtSort direction:
asc or descNumber of messages per page
Response
Array of message objects
Cursor for next page, null if no more results
Get Messages by Conversation
Path Parameters
The conversation ID
Response
Returns an array of message objects (excludes internal MongoDB fields_id, __v, user).
Get Specific Message
Path Parameters
The conversation ID
The message ID
Response
Returns the message object or 404 Not Found if the message doesn’t exist.Create Message
Path Parameters
The conversation ID
Request Body
Unique message identifier (UUID)
ID of the previous message in the thread
Message text content (legacy)
Structured content array with parts like text, images, or tool calls
Whether this is a user message
Sender name (e.g., “User” or model name)
Endpoint identifier
Model name
Response
Returns the saved message object.Error Responses
- 400 Bad Request: Message not saved
- 500 Internal Server Error: Save failed
Update Message Text
Path Parameters
The conversation ID
The message ID
Request Body
New text content
Model name (for token counting)
Content part index to update (optional, updates entire message if omitted)
Response
Returns the updated message object.Error Responses
- 400 Bad Request: Invalid index or attempting to update non-text content
- 404 Not Found: Message not found
- 500 Internal Server Error: Update failed
Update Message Feedback
Path Parameters
The conversation ID
The message ID
Request Body
Feedback object (set to
null to clear feedback)Response
The message ID
The conversation ID
Updated feedback object
Delete Message
Path Parameters
The conversation ID
The message ID
Response
Returns 204 No Content on success.Branch Message (Parallel Agents)
Request Body
Source message ID
Agent ID to filter content by
Response
Returns the newly created branch message with content filtered to only include parts from the specified agent.Error Responses
- 400 Bad Request: Missing parameters, attempting to branch from user message, or no content found for agent
- 404 Not Found: Source message not found
- 500 Internal Server Error: Branch creation failed
Edit Artifact
Path Parameters
The message ID containing the artifact
Request Body
Artifact index (0-based)
Original artifact content to replace
New artifact content
Response
The conversation ID
Updated message content array
Updated message text
Error Responses
- 400 Bad Request: Invalid parameters or artifact not found
- 404 Not Found: Message not found
- 500 Internal Server Error: Update failed
Common Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or unsupported operation |
| 401 | Unauthorized - Invalid or missing JWT token |
| 403 | Forbidden - User lacks permission to access the conversation |
| 404 | Not Found - Message or conversation does not exist |
| 500 | Internal Server Error - Server-side error occurred |