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

# List Sessions

> List AI Ask sessions in a project, newest activity first

List AI Ask sessions, ordered by most recent activity. Optionally filter by end user, scope, recording, or a title search.

## Authentication

Requires an [API key](/authentication). `end_user_id` is an optional filter: omit it and a project-scoped key lists the whole project; an end-user-scoped key always lists only its own sessions.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.bota.dev/v1/ask/sessions?end_user_id=eu_abc123&limit=20" \
    -H "Authorization: Bearer sk_live_..."
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({ end_user_id: 'eu_abc123', limit: '20' });
  const response = await fetch(`https://api.bota.dev/v1/ask/sessions?${params}`, {
    headers: { 'Authorization': 'Bearer sk_live_...' },
  });

  const { data, has_more, next_cursor } = await response.json();
  ```

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

  response = requests.get(
      'https://api.bota.dev/v1/ask/sessions',
      headers={'Authorization': 'Bearer sk_live_...'},
      params={'end_user_id': 'eu_abc123', 'limit': 20},
  )

  sessions = response.json()['data']
  ```
</RequestExample>

## Query Parameters

<ParamField query="end_user_id" type="string">
  Optional. Narrow the list to one end user (`eu_*`). Omit it to list all sessions in the project (project-scoped keys only; an end-user-scoped key is always limited to its own).
</ParamField>

<ParamField query="scope_type" type="string">
  Filter by scope: `recording`, `library`, `selected`, or `folder`.
</ParamField>

<ParamField query="recording_id" type="string">
  Only sessions scoped to this recording (`rec_*`).
</ParamField>

<ParamField query="q" type="string">
  Case-insensitive substring match against the session title.
</ParamField>

<ParamField query="limit" type="integer" default="20">
  Maximum number of sessions to return (1–100).
</ParamField>

<ParamField query="cursor" type="string">
  Pagination cursor from a previous response's `next_cursor`.
</ParamField>

## Response

Returns a paginated list of [session objects](/api-reference/ask/get-session#response), newest activity first.

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": "as_abc123",
        "scope": { "type": "library", "recording_ids": [], "recording_title": null },
        "title": "What did I commit to this week?",
        "message_count": 4,
        "last_message_at": "2026-05-20T10:23:45Z",
        "last_model": "gemini-2.0-flash",
        "last_provider": "gemini",
        "created_at": "2026-05-20T10:20:00Z",
        "updated_at": "2026-05-20T10:23:45Z"
      }
    ],
    "has_more": false,
    "next_cursor": null
  }
  ```
</ResponseExample>
