Get session message history
curl --request GET \
--url http://co-mind-platform-host/v1/chat/sessions/{id}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://co-mind-platform-host/v1/chat/sessions/{id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://co-mind-platform-host/v1/chat/sessions/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://co-mind-platform-host/v1/chat/sessions/{id}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://co-mind-platform-host/v1/chat/sessions/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "msg_001",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "user",
"content": "What are the main features of your product?",
"created_at": 1699564800
},
{
"id": "msg_002",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "Our product has three main features - advanced analytics, real-time collaboration, and automated workflows.",
"created_at": 1699564801,
"knowledge_base_context": {
"sources": [
{
"knowledgebase_id": "kb_abc123",
"document_id": "doc_123",
"title": "Product Overview",
"relevance_score": 0.95,
"page": 2
}
]
}
},
{
"id": "msg_003",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "user",
"content": "Can you tell me more about the analytics feature?",
"created_at": 1699564820
},
{
"id": "msg_004",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "The analytics feature provides real-time dashboards, custom reports, and predictive insights using machine learning algorithms.",
"created_at": 1699564821,
"knowledge_base_context": {
"sources": [
{
"knowledgebase_id": "kb_abc123",
"document_id": "doc_456",
"title": "Analytics Documentation",
"relevance_score": 0.92,
"page": 5
}
]
}
},
{
"id": "msg_005",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "user",
"content": "What machine learning algorithms do you support?",
"created_at": 1699564840
},
{
"id": "msg_006",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "We support several ML algorithms including linear regression, decision trees, random forests, gradient boosting, and neural networks for deep learning tasks.",
"created_at": 1699564841
}
],
"has_more": false
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Chat
Get session message history
Get conversation history for a chat session. Returns all messages in chronological order.
Example use case: A customer support session where the user asks multiple questions about a product.
GET
/
v1
/
chat
/
sessions
/
{id}
/
messages
Get session message history
curl --request GET \
--url http://co-mind-platform-host/v1/chat/sessions/{id}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://co-mind-platform-host/v1/chat/sessions/{id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://co-mind-platform-host/v1/chat/sessions/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://co-mind-platform-host/v1/chat/sessions/{id}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://co-mind-platform-host/v1/chat/sessions/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "msg_001",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "user",
"content": "What are the main features of your product?",
"created_at": 1699564800
},
{
"id": "msg_002",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "Our product has three main features - advanced analytics, real-time collaboration, and automated workflows.",
"created_at": 1699564801,
"knowledge_base_context": {
"sources": [
{
"knowledgebase_id": "kb_abc123",
"document_id": "doc_123",
"title": "Product Overview",
"relevance_score": 0.95,
"page": 2
}
]
}
},
{
"id": "msg_003",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "user",
"content": "Can you tell me more about the analytics feature?",
"created_at": 1699564820
},
{
"id": "msg_004",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "The analytics feature provides real-time dashboards, custom reports, and predictive insights using machine learning algorithms.",
"created_at": 1699564821,
"knowledge_base_context": {
"sources": [
{
"knowledgebase_id": "kb_abc123",
"document_id": "doc_456",
"title": "Analytics Documentation",
"relevance_score": 0.92,
"page": 5
}
]
}
},
{
"id": "msg_005",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "user",
"content": "What machine learning algorithms do you support?",
"created_at": 1699564840
},
{
"id": "msg_006",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "We support several ML algorithms including linear regression, decision trees, random forests, gradient boosting, and neural networks for deep learning tasks.",
"created_at": 1699564841
}
],
"has_more": false
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Authorizations
Bearer token authentication. Supports two token types:
- JWT Access Token — obtained via
POST /v1/auth/login - Personal Access Token (PAT) — created via
POST /v1/api-tokens, format:cmnd_<tokenId>.<secret>
Path Parameters
The session ID
Query Parameters
Maximum number of messages to return
Message ID to paginate before
Message ID to paginate after
⌘I

