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

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

Query Parameters

limit
integer
default:50

Maximum number of messages to return

before
string

Message ID to paginate before

after
string

Message ID to paginate after

Response

Message history

object
string
Example:

"list"

data
object[]
has_more
boolean
Example:

false