Skip to main content
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
}
'
{
  "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
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

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

id
string
required

The session ID

Body

application/json
content
string
required

The user message content

Example:

"What are the main features?"

stream
boolean
default:false

Enable streaming responses

Response

Message sent successfully

id
string
Example:

"msg_abc123"

object
string
Example:

"chat.message"

session_id
string
Example:

"session_xyz789"

role
enum<string>
Available options:
user,
assistant,
system
Example:

"assistant"

content
string
Example:

"The main features include..."

created_at
integer

Unix timestamp

Example:

1699564800

knowledge_base_context
object