v1
Messages

Get Session History

Retrieve message history for a specific conversation session.

**Authentication Required**: Bearer token, API key, or session token

**Pagination**:
- Use `limit` and `skip` parameters for pagination
- Messages are returned in **reverse chronological order** (newest first)
- `total_count` indicates total messages in the session

**Summaries** (if available):
- Returns hierarchical conversation summaries (short/medium/long-term)
- Includes `context_for_llm` field with pre-compressed context
- Summaries are automatically generated every 15 messages
- Use `/sessions/{session_id}/compress` endpoint to retrieve on-demand

**Access Control**:
- Only returns messages for the authenticated user
- Workspace scoping is applied if available
get/v1/messages/sessions/{session_id}

Path parameters

session_idstring required

Query parameters

limitinteger

Maximum number of messages to return

Maximum number of messages to return

skipinteger

Number of messages to skip for pagination

Number of messages to skip for pagination

Response

Message history retrieved

sessionIdstring required

Session ID of the conversation

total_countinteger required

Total number of messages in the session

context_for_llmstring nullable

Pre-formatted compressed context ready for LLM consumption (summaries + recent messages)

Example response

{
  "context_for_llm": "FULL SESSION: Product planning and strategy conversation\nRECENT (last ~100): Ongoing product planning discussion for Q4\nCURRENT (last 15): User requested help planning Q4 product roadmap",
  "messages": [
    {
      "content": "Can you help me plan the Q4 product roadmap?",
      "createdAt": "2024-01-15T10:30:00Z",
      "objectId": "msg_abc123",
      "processing_status": "completed",
      "role": "user",
      "sessionId": "session_123"
    },
    {
      "content": "I'd be happy to help you plan your Q4 roadmap. Let's start by identifying your key objectives.",
      "createdAt": "2024-01-15T10:31:00Z",
      "objectId": "msg_def456",
      "processing_status": "completed",
      "role": "assistant",
      "sessionId": "session_123"
    }
  ],
  "sessionId": "session_123",
  "summaries": {
    "long_term": "Product planning and strategy conversation",
    "medium_term": "Ongoing product planning discussion for Q4",
    "short_term": "User requested help planning Q4 product roadmap",
    "topics": [
      "product",
      "roadmap",
      "planning",
      "Q4"
    ]
  },
  "total_count": 2
}

Changes

Changed in 9 of the 37 revisions of this API.1726

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added subschema #2 to the // response property anyOf list for the response status

      response-property-any-of-added

    • ○

      removed from the // response property anyOf list for the response status

      response-property-any-of-removed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property // from the response with the status

      response-optional-property-removed

    This revision also has 8 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      added to the // response property anyOf list for the response status

      response-property-any-of-added

    • ○

      removed subschema #2 from the // response property anyOf list for the response status

      response-property-any-of-removed

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the required property ///// to the response with the status

      response-required-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      endpoint added

      endpoint-added

    • ▲

      api path removed without deprecation

      api-path-removed-without-deprecation

    • ○

      endpoint added

      endpoint-added

    This revision also has 12 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog