---
title: Conversation History
protocol: rest
method: GET
endpoint: /v1/projects/{projectId}/chat/sessions
description: "List a visitor's chat conversations and load transcripts for the agentic-mode ask page."
---

# Conversation History

List a visitor's past chat conversations and load full transcripts. These endpoints power the sidebar of the doc site's [agentic mode](/platform/doc-site-features) (`/ask` page — available when the **Agentic Mode add-on** is enabled), where visitors can search, resume, and replay previous conversations.

Both endpoints are public (no API key required) but strictly scoped: a conversation is only returned when it belongs to **both** the project and the requesting `visitorId` — one visitor can never read another visitor's conversations.

## List Conversations

<Endpoint method="GET" path="/v1/projects/{projectId}/chat/sessions" />

### Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID.
</ParamField>

### Query Parameters

<ParamField query="visitorId" type="string" required>
  The anonymous visitor identifier the conversations belong to (max 100 chars). Same value the visitor sends on the [chat endpoint](/api-reference/chat/ask).
</ParamField>

### Response

Up to 50 conversations, newest first. Each conversation is titled from its first question.

```json
{
  "data": {
    "sessions": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "title": "How do I add a custom domain?",
        "createdAt": "2026-07-12T09:30:00.000Z"
      }
    ]
  }
}
```

## Load a Transcript

<Endpoint method="GET" path="/v1/projects/{projectId}/chat/sessions/{sessionId}" />

### Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID.
</ParamField>

<ParamField path="sessionId" type="string" required>
  UUID of the conversation to load.
</ParamField>

### Query Parameters

<ParamField query="visitorId" type="string" required>
  The anonymous visitor identifier. Must match the visitor that created the session — otherwise `404`.
</ParamField>

### Response

The conversation's messages in chronological order (up to 100).

```json
{
  "data": {
    "messages": [
      {
        "id": "9b2e6c1a-…",
        "role": "user",
        "content": "How do I add a custom domain?",
        "createdAt": "2026-07-12T09:30:00.000Z"
      },
      {
        "id": "4f81d3b7-…",
        "role": "assistant",
        "content": "Go to Settings → Custom Domains… [guides/custom-domains]",
        "createdAt": "2026-07-12T09:30:04.000Z"
      }
    ]
  }
}
```

## Error Responses

| Status | Code | When |
|--------|------|------|
| `400` | `INVALID_REQUEST` | Missing `visitorId`, or the session ID is not a UUID |
| `404` | `NOT_FOUND` | The session doesn't exist, or belongs to a different project or visitor |

## Example

```bash cURL
curl "https://api.syntext.dev/v1/projects/prj_abc123/chat/sessions?visitorId=vis_9f8e7d"
```

## Related

- [Ask the AI Assistant](/api-reference/chat/ask) — start or continue a conversation
- [Agentic mode](/platform/doc-site-features) — the `/ask` page these endpoints power
