---
title: "Get Session History"
method: GET
path: "/v1/messages/sessions/{session_id}"
tags: ["v1", "Messages"]
---

# Get Session History

`GET /v1/messages/sessions/{session_id}`

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

## Path parameters

- `session_id` string, required

## Query parameters

- `limit` integer — Maximum number of messages to return
- `skip` integer — Number of messages to skip for pagination

## Response `200`

Message history retrieved

- MessageHistoryResponse — Response model for retrieving message history
  - `sessionId` string, required — Session ID of the conversation
  - `messages` MessageResponse[], required — List of messages in chronological order
    - `objectId` string, required — Parse Server objectId of the stored message
    - `sessionId` string, required — Session ID of the conversation
    - `role` 'user' | 'assistant', required — Role of the message sender
    - `content` union, required — Content of the message - can be a simple string or structured content objects
      - string
      - MessageContentBlock[]
        - `type` string, required — Content block type (e.g. 'text')
        - `text` string, nullable — Text payload when type is 'text'
    - `createdAt` string, date-time, required — When the message was created
    - `processing_status` string — Status of background processing (queued, analyzing, completed, failed)
  - `total_count` integer, required — Total number of messages in the session
  - `summaries` ConversationSummaryResponse — Hierarchical conversation summaries for context window compression
    - `short_term` string, nullable — Summary of last 15 messages
    - `medium_term` string, nullable — Summary of last ~100 messages
    - `long_term` string, nullable — Full session summary
    - `topics` string[] — Key topics discussed
    - `last_updated` string, date-time, nullable — When summaries were last updated
    - `session_intent` string, nullable — What the user is trying to accomplish in this session
    - `key_decisions` string[] — Important decisions made and their reasoning
    - `current_state` string, nullable — Current progress: what is working, not working, blocked, or unverified
    - `next_steps` string[] — Specific actionable next steps
    - `technical_details` string[] — Technical details to remember (URLs, errors, config values, function names)
    - `files_accessed` object, nullable — Files read, modified, created, or deleted during the session
    - `project_context` object, nullable — Detected project context (name, path, tech stack, current task)
  - `context_for_llm` string, nullable — Pre-formatted compressed context ready for LLM consumption (summaries + recent messages)

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Session not found
- `422` — Validation Error
- `500` — Internal server error

---

[API](https://skmtc.net/papr-ai/apis/papr-memory-api.md) · [All operations](https://skmtc.net/papr-ai/apis/papr-memory-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/papr-ai/papr-memory-api/revisions/b553be9aad37/schema)
