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

# List Lexi Conversations

> Paginate over saved Lexi AI conversations for the workspace

## Request

### Query Parameters

<ParamField query="page" type="integer" default="1">
  Page number.
</ParamField>

<ParamField query="per_page" type="integer" default="25">
  Results per page. Maximum 100.
</ParamField>

<ParamField query="search" type="string">
  Optional full-text search against conversation titles and message content.
</ParamField>

<ParamField query="user_id" type="string">
  Filter by the user who owns the conversation. When omitted, returns conversations for the current API key's user.
</ParamField>

<ParamField query="contact_id" type="string">
  Filter to conversations tied to the given contact context.
</ParamField>

<ParamField query="deal_id" type="string">
  Filter to conversations tied to the given deal context.
</ParamField>

<ParamField query="archived" type="boolean" default="false">
  When `true`, includes archived conversations.
</ParamField>

### Headers

```
Authorization: Bearer wbk_your_api_key_here
```

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="conversations" type="array">
      <Expandable title="Conversation object">
        <ResponseField name="id" type="string">Conversation UUID</ResponseField>
        <ResponseField name="title" type="string">Auto-generated or user-edited title</ResponseField>
        <ResponseField name="message_count" type="integer">Total messages exchanged</ResponseField>
        <ResponseField name="last_message_at" type="string">ISO 8601 timestamp</ResponseField>
        <ResponseField name="context" type="object">Entity context: `contact_id`, `deal_id`, `matter_id`</ResponseField>
        <ResponseField name="archived" type="boolean">Archive state</ResponseField>
        <ResponseField name="created_at" type="string">ISO 8601 creation timestamp</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  Pagination metadata: `page`, `per_page`, `total`.
</ResponseField>

Responses include `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, and `X-Request-ID`.

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://data.leadlex.com/functions/v1/api-gateway/v1/lexi/conversations?per_page=50" \
    -H "Authorization: Bearer wbk_your_api_key_here"
  ```

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

  API_KEY = "wbk_your_api_key_here"
  BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"

  r = requests.get(
      f"{BASE_URL}/v1/lexi/conversations",
      headers={"Authorization": f"Bearer {API_KEY}"},
      params={"per_page": 50},
  )
  for c in r.json()["data"]["conversations"]:
      print(c["title"], c["last_message_at"])
  ```

  ```javascript JavaScript theme={null}
  const url = new URL('https://data.leadlex.com/functions/v1/api-gateway/v1/lexi/conversations');
  url.searchParams.set('per_page', '50');
  const res = await fetch(url, { headers: { Authorization: 'Bearer wbk_your_api_key_here' } });
  const { data } = await res.json();
  console.log(data.conversations.length);
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "data": {
    "conversations": [
      {
        "id": "conv_01HY1",
        "title": "Series B research for Acme Corp",
        "message_count": 14,
        "last_message_at": "2026-04-17T10:30:00Z",
        "context": { "contact_id": "123e4567-e89b-12d3-a456-426614174000" },
        "archived": false,
        "created_at": "2026-04-15T09:00:00Z"
      }
    ]
  },
  "meta": { "page": 1, "per_page": 50, "total": 27 }
}
```

## Errors

| Status | Code                       | Description                  |
| ------ | -------------------------- | ---------------------------- |
| 401    | `invalid_key`              | Invalid or expired API key   |
| 403    | `insufficient_permissions` | Missing `read:ai` permission |
| 429    | `rate_limited`             | Rate limit exceeded          |
