---
title: "Read a chat session's messages"
method: GET
path: "/chat-sessions/{sessionId}"
tags: ["Chat sessions"]
---

# Read a chat session's messages

`GET /chat-sessions/{sessionId}`

Session metadata plus a bounded window of its raw messages.

`index` on each message is its ABSOLUTE position in the stored transcript, not its position in the returned page: trace spans reference messages positionally, so this read and `/trace` join on that number.

A transcript that could not be read reports `transcriptUnavailable: true` and a **null** `messageCount` — never 0, which would claim the conversation is empty.

## Path parameters

- `sessionId` string, required

## Query parameters

- `projectId` string
- `afterMessageIndex` integer
- `limit` integer

## Response `200`

The session and one window of its messages.

- ChatSessionDetail
  - `sessionId` string, required
  - `projectId` string, nullable, required
  - `origin` string, nullable, required
  - `modelId` string, nullable, required
  - `version` integer, nullable, required
  - `startedAt` integer, nullable, required
  - `lastActivityAt` integer, nullable, required
  - `toolMode` 'read_only' | 'auto' | 'null', nullable, required
  - `environmentId` string, nullable, required
  - `messageCount` integer, nullable, required — NULL — never 0 — when the transcript could not be read. Zero would claim the conversation is empty.
  - `transcriptUnavailable` boolean
  - `messages` ChatMessage[], required
    - `index` integer, required — ABSOLUTE position in the stored transcript — the number trace spans reference. Never renumbered per page.
    - `role` string, required
    - `content` unknown, required
    - `truncated` boolean
  - `nextMessageIndex` integer

## Other responses

- `400` — Malformed body or parameters.
- `401` — Missing, invalid, revoked, or orphaned key (`UNAUTHORIZED`) — or the **target MCP server** needs an OAuth grant (`OAUTH_REQUIRED`), which is a property of the server, not your key.
- `403` — Key is valid but not allowed to do this.
- `404` — Unknown project, server, or resource.
- `429` — Per-key rate limit exceeded (60 requests/minute sustained, bursts up to 10). Honor `Retry-After` and back off with jitter.
- `500` — Something failed on MCPJam's side.
- `502` — Could not connect to the target MCP server.

---

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