Send message to session
curl --request POST \
--url http://co-mind-platform-host/v1/chat/sessions/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "What are the main features?",
"stream": false
}
'import requests
url = "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
payload = {
"content": "What are the main features?",
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: 'What are the main features?', stream: false})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => 'What are the main features?',
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
payload := strings.NewReader("{\n \"content\": \"What are the main features?\",\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://co-mind-platform-host/v1/chat/sessions/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"What are the main features?\",\n \"stream\": false\n}")
.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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"What are the main features?\",\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_abc123",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "The main features include...",
"created_at": 1699564800,
"knowledge_base_context": {
"sources": [
{
"knowledgebase_id": "<string>",
"document_id": "<string>",
"title": "<string>",
"content": "<string>",
"page": 123,
"relevance_score": 123
}
]
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error",
"code": "bad_request"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Chat
Send message to session
Send a message to a chat session (history managed by server)
POST
/
v1
/
chat
/
sessions
/
{id}
/
messages
Send message to session
curl --request POST \
--url http://co-mind-platform-host/v1/chat/sessions/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "What are the main features?",
"stream": false
}
'import requests
url = "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
payload = {
"content": "What are the main features?",
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: 'What are the main features?', stream: false})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => 'What are the main features?',
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://co-mind-platform-host/v1/chat/sessions/{id}/messages"
payload := strings.NewReader("{\n \"content\": \"What are the main features?\",\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://co-mind-platform-host/v1/chat/sessions/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"What are the main features?\",\n \"stream\": false\n}")
.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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"What are the main features?\",\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_abc123",
"object": "chat.message",
"session_id": "session_xyz789",
"role": "assistant",
"content": "The main features include...",
"created_at": 1699564800,
"knowledge_base_context": {
"sources": [
{
"knowledgebase_id": "<string>",
"document_id": "<string>",
"title": "<string>",
"content": "<string>",
"page": 123,
"relevance_score": 123
}
]
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error",
"code": "bad_request"
}
}{
"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
Body
application/json
Response
Message sent successfully
Example:
"msg_abc123"
Example:
"chat.message"
Example:
"session_xyz789"
Available options:
user, assistant, system Example:
"assistant"
Example:
"The main features include..."
Unix timestamp
Example:
1699564800
Show child attributes
Show child attributes
⌘I

