# Get conversation with messages

> Source: https://docs.clonepartner.com/api-reference/ai/get-ai-conversation/

`GET /api/ai/conversations/{id}`

Get conversation with messages

**Operation ID:** `getAiConversation`

## Authentication

### Option 1

- **BearerAuth** (`http bearer`)
  API key token. Create via POST /api/api-keys. Format: `envoy_<hex>`

### Option 2

- **CookieAuth** (`apiKey`)
  Session cookie set after login + TOTP verification

## Path parameters

- `id` — `integer`, `required`
  Resource ID

## Success responses

### 200

Conversation and messages. Message `role` may be `user`, `assistant`,
or `summary` (auto-compaction divider). Summary rows include
`summarized_through_seq`. Conversation may include `last_context_tokens`.


## Error responses

### 404

Not found


## Examples

### cURL

```bash
curl --request GET \
  --url 'https://your-envoy.example.com/api/ai/conversations/YOUR_ID' \
  --header 'Authorization: Bearer $API_KEY'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/ai/conversations/YOUR_ID', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  },
});

if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);
```
