---
title: "Get a Copilot chat"
method: GET
path: "/ai-chats/{chatId}"
tags: ["AIChats", "Beta"]
---

# Get a Copilot chat

`GET /ai-chats/{chatId}`

## Request

- Base URL: `https://public.escape.tech/v3`
- URL: `https://public.escape.tech/v3/ai-chats/{chatId}`
- Auth: API key in header `X-ESCAPE-API-KEY`

Get a Copilot chat owned by the authenticated user together with a preview of its message history (up to 100 messages, oldest first). Use `messagesTotalCount` to detect a truncated preview and GET /v3/ai-chats/{chatId}/messages to page through the full history.

## Path parameters

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

## Response `200`

OK

- object
  - `id` string, uuid, required: The id of the chat
  - `title` string, required: The title of the chat
  - `createdAt` string, date-time, required: The date and time the chat was created
  - `messages` object[], required: The messages of the chat, oldest first (up to 100 messages)
    - `id` string, uuid, required: The id of the message
    - `role` 'ASSISTANT' | 'SYSTEM' | 'TOOL' | 'USER', required: The role of the message author
    - `content` string, required: The message content
    - `createdAt` string, date-time, required: The date and time the message was created
  - `messagesTotalCount` integer, required: The total number of messages in the chat. When it is greater than the length of `messages`, the preview is truncated and the full history is available on the paginated messages endpoint.

## Other responses

- `404`: Not found

---

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