---
title: "Get all chat messages in a thread"
method: GET
path: "/api/v5/ai-chat/messages/"
tags: ["Ai Chat Messages"]
---

# Get all chat messages in a thread

`GET /api/v5/ai-chat/messages/`

## Request

- Base URL: `https://api.pavlok.com`
- URL: `https://api.pavlok.com/api/v5/ai-chat/messages/`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/pavlok/apis/pavlok-api-v5/docs/api/v5/ai-chat/messages/get.ts> (a function with typed inputs; its response is checked against the schema)

Get all messages within a specific thread.

## Query parameters

- `thread_id` integer, required: The ID of the chat thread

## Response `200`

Successful Response

- ListOfAiChatMessagesInResponse
  - `messages` AiChatMessage[], required: List of chat messages
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `deletedAt` string, date-time
    - `id` integer
    - `threadId` integer, required: ID of the associated chat thread
    - `role` 'system' | 'user' | 'assistant' | 'tool', required: An enumeration.
    - `content` string: Full message content
    - `displayContent` string: Message content to be displayed
    - `hidden` boolean: Flag to hide/show the message
    - `functionName` string: Tool function name
    - `toolCalls` object[]: Tools call
    - `toolCallId` string: Tools call id

## Other responses

- `422`: Validation Error

---

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