> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agntix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Messages

> Returns every utterance in a session — user, assistant, and tool calls — ordered chronologically.

<Note>
  Every endpoint on this page requires either a Clerk-issued JWT (`Authorization: Bearer <token>`) or
  an organization API key (`x-api-key: pk_…`). Anonymous calls return `401 Unauthorized`. See
  [Authentication](/authentication) for the full setup.
</Note>

Returns every utterance — user, assistant, and tool calls if any. This is the source-of-truth for QA reviewers and for re-training extraction prompts.

<Tip>
  **Don't poll. Pull-on-event.** Receive the [`session.ended`](/webhooks/events) webhook first, persist the summary fields, then fetch the transcript asynchronously and stash it in object storage (S3/GCS) for your reviewer UI.
</Tip>

## Code examples

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.agntix.ai/api/v1/chat/sessions/$SESSION_ID/messages" \
    -H "x-api-key: $AGNTIX_API_KEY" \
    -H "Accept: application/json"
  ```

  ```javascript Node.js theme={null}
  const sessionId = "4981804c-2658-4893-84ff-9c2fa90fb3c2";

  const { data: messages } = await fetch(
    `https://api.agntix.ai/api/v1/chat/sessions/${sessionId}/messages`,
    { headers: { "x-api-key": process.env.AGNTIX_API_KEY } },
  ).then((r) => r.json());

  for (const msg of messages) {
    console.log(`[${msg.role}] ${msg.content}`);
  }
  ```

  ```python Python theme={null}
  import os, requests

  session_id = "4981804c-2658-4893-84ff-9c2fa90fb3c2"

  result = requests.get(
      f"https://api.agntix.ai/api/v1/chat/sessions/{session_id}/messages",
      headers={"x-api-key": os.environ["AGNTIX_API_KEY"]},
  ).json()

  for msg in result["data"]:
      print(f"[{msg['role']}] {msg['content']}")
  ```
</CodeGroup>

## Sample response

```json theme={null}
{
  "data": [
    {
      "id": "msg_01j3m_user",
      "content": "Hi, this is Alex.",
      "role": "USER",
      "createdAt": "2026-04-08T05:00:03.120Z"
    },
    {
      "id": "msg_01j3m_assistant",
      "content": "Hello Alex, I'm calling about your order #88291. Is now a good time?",
      "role": "ASSISTANT",
      "createdAt": "2026-04-08T05:00:04.001Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 2,
    "totalPages": 1
  }
}
```
