---
title: "List messages in a chat"
method: GET
path: "/chats/{id}/messages"
tags: ["Chats"]
---

# List messages in a chat

`GET /chats/{id}/messages`

## Request

- Base URL: `https://app.gc.ai/api/external/v1`
- URL: `https://app.gc.ai/api/external/v1/chats/{id}/messages`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/gc-ai/apis/gc-ai-external-api/docs/chats/:id/messages/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieve the message history of a chat with pagination. Returns all messages including branched versions — use `parent_id` to reconstruct the conversation tree.

## Path parameters

- `id` string, uuid, required: The chat ID

## Query parameters

- `limit` integer: Max items to return (default 100, max 500)
- `offset` integer, nullable: Number of items to skip (default 0)
- `order` 'asc' | 'desc': Sort order by creation time (default: asc)

## Response `200`

Paginated list of messages

- MessageListResponse
  - `messages` MessageResponse[], required
    - `id` string, required: Unique message identifier
    - `role` string, required: Message role (user, assistant, system, tool)
    - `content` string, nullable, required: Plain text content of the message
    - `parts` object[], nullable, required: Structured message parts (text, tool invocations, file references)
    - `parent_id` string, nullable, required: Parent message ID for branching conversations
    - `version` number, required: Message version number
    - `created_at` string, required: ISO 8601 creation timestamp
  - `pagination` Pagination, required
    - `limit` number, required: Page size
    - `offset` number, required: Current offset
    - `has_more` boolean, required: Whether more results exist

## Other responses

- `400`: Invalid chat ID or query parameters
- `401`: Missing or malformed API key
- `403`: Invalid API key
- `404`: Chat not found or access denied
- `429`: Rate limit exceeded. See [Rate Limits](https://docs.gc.ai/api-reference/concepts/rate-limits) for the tiers, limits, and how to back off.
- `500`: Internal server error
- `503`: Service temporarily unavailable

---

[API](https://skmtc.dev/gc-ai/apis/gc-ai-external-api.md) - [All operations](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/revisions/2bbdfddf7107?raw)
