List thread messages

Lists a thread's turns with cursor pagination so a conversation can be re-rendered

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Lists the turns in a thread, oldest first, so you can re-render a conversation after your page reloads.

Each message is one turn — the question that was asked and how that turn ended. To get the full contents of any one of them, pass its threadResponseId to Get a turn's result.

Basic Usage

GET /v2/projects/1/threads/5/messages?limit=20
{
  "messages": [
    {
      "threadResponseId": 7,
      "question": "Which 5 states have the most customers?",
      "status": "FINISHED",
      "createdAt": "2026-08-02T09:14:22.000Z"
    },
    {
      "threadResponseId": 8,
      "question": "How many of those customers ordered more than once?",
      "status": "FINISHED",
      "createdAt": "2026-08-02T09:15:07.000Z"
    }
  ],
  "nextCursor": null
}

Query Parameters

ParameterTypeDefaultDescription
cursornumberfirst pageCursor from the previous page's nextCursor. Omit for the first page.
limitnumber20Page size.

nextCursor is null on the last page.

Re-rendering a conversation

// 1. Page through the thread.
const messages = [];
let cursor;
do {
  const page = await listMessages(projectId, threadId, { cursor, limit: 50 });
  messages.push(...page.messages);
  cursor = page.nextCursor;
} while (cursor);

// 2. Fetch the full contents of each turn.
const turns = await Promise.all(
  messages.map((m) => getResult(m.threadResponseId)),
);

Then continue the conversation by passing the same threadId to Agentic-mode ask.

🔗

Learn more


Path Params
integer
required

Project ID.

integer
required
Query Params
integer

Last threadResponseId already seen; returns turns after it.

integer
≤ 100
Defaults to 20
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json