curl --request POST \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
}
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/messages', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatId: "chat_123abc",
role: "user",
parts: [
{
type: "text",
text: "Hello, how can you help me today?"
}
],
attachments: [],
metadata: {
source: "web"
}
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/messages"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Message created successfully",
"data": {
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
},
"createdAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Messages
Create Message
Creates a new message in a specific chat
POST
/
api
/
chats
/
{chatId}
/
messages
curl --request POST \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
}
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/messages', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatId: "chat_123abc",
role: "user",
parts: [
{
type: "text",
text: "Hello, how can you help me today?"
}
],
attachments: [],
metadata: {
source: "web"
}
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/messages"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Message created successfully",
"data": {
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
},
"createdAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Path Parameters
string
required
Chat ID where the message will be created
Body Parameters
string
Optional message ID
string
required
Chat ID (must match path parameter)
string
required
Message role (e.g., “user”, “assistant”, “system”)
array
required
array
Array of attachment IDs (strings)
object
Additional metadata for the message
Response
boolean
Indicates if the message was created successfully
string
Success or error message
object
The created message object
curl --request POST \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
}
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/messages', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatId: "chat_123abc",
role: "user",
parts: [
{
type: "text",
text: "Hello, how can you help me today?"
}
],
attachments: [],
metadata: {
source: "web"
}
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/messages"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Message created successfully",
"data": {
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"metadata": {
"source": "web"
},
"createdAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
⌘I

