curl --request GET \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/messages', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"messages": [
{
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:00Z"
},
{
"id": "msg_789ghi",
"chatId": "chat_123abc",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "I'd be happy to help! What would you like to know?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:15Z"
}
],
"message": "Messages fetched successfully"
}
{
"success": false,
"messages": [],
"message": "Unauthorized"
}
{
"success": false,
"messages": [],
"message": "Chat not found"
}
Messages
List Messages
Retrieves all messages in a specific chat
GET
/
api
/
chats
/
{chatId}
/
messages
curl --request GET \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/messages', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"messages": [
{
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:00Z"
},
{
"id": "msg_789ghi",
"chatId": "chat_123abc",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "I'd be happy to help! What would you like to know?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:15Z"
}
],
"message": "Messages fetched successfully"
}
{
"success": false,
"messages": [],
"message": "Unauthorized"
}
{
"success": false,
"messages": [],
"message": "Chat not found"
}
Path Parameters
string
required
Chat ID to retrieve messages from
Response
boolean
Indicates if the request was successful
array
Array of message objects in the chat
string
Response message
curl --request GET \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/messages', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"messages": [
{
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:00Z"
},
{
"id": "msg_789ghi",
"chatId": "chat_123abc",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "I'd be happy to help! What would you like to know?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:15Z"
}
],
"message": "Messages fetched successfully"
}
{
"success": false,
"messages": [],
"message": "Unauthorized"
}
{
"success": false,
"messages": [],
"message": "Chat not found"
}
⌘I

