---
title: "Load messages for a chat, newest-first window returned oldest-first"
method: GET
path: "/v2/assistant/chats/{chat_id}/messages"
tags: ["assistant"]
---

# Load messages for a chat, newest-first window returned oldest-first

`GET /v2/assistant/chats/{chat_id}/messages`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/assistant/chats/{chat_id}/messages`
- Auth: HTTP bearer

Pass `before=<created_at>` of the earliest message currently rendered to
fetch an older page. The caller stitches pages together in the UI.

## Path parameters

- `chat_id` string, uuid, required

## Query parameters

- `before` string, date-time, nullable
- `limit` integer

## Response `200`

Successful Response

- CortexUIMessage[]
  - `id` string, required
  - `role` 'user' | 'assistant' | 'system', required
  - `parts` union[], required
    - union
      - TextPart
        - `type` 'text', required
        - `text` string, required
      - ReasoningPart
        - `type` 'reasoning', required
        - `reasoning` string, required
      - ToolInvocationPart
        - `type` 'tool-invocation', required
        - `toolCallId` string, required
        - `toolName` string, required
        - `args` object, required
        - `state` string, required
        - `result` object, nullable, required
      - FilePart
        - `type` 'file', required
        - `mediaType` string, nullable, required
        - `url` string, nullable, required
      - SourceUrlPart
        - `type` 'source-url', required
        - `sourceId` string, nullable, required
        - `url` string, nullable, required
        - `title` string, nullable, required
      - CortexDataTablePart
        - `type` 'data-table', required
        - `data` object, required
      - CortexDataChartPart
        - `type` 'data-chart', required
        - `data` object, required
      - CortexDataSuggestionsPart
        - `type` 'data-suggestions', required
        - `data` object, required
  - `createdAt` string, date-time, nullable, required
  - `context` CortexChatContext, required
    - `entities` CortexContextEntity[], required
      - `type` 'customer' | 'invoice' | 'task', required
      - `id` string, required
      - `displayName` string, nullable, required
  - `feedback` 'positive' | 'negative', nullable, required
  - `feedbackMessage` string, nullable, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/ff0ad16a55ff?raw)
