> ## 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.

# Get Session

> Retrieve a single AI Ask session

Retrieve a single AI Ask session. To fetch its conversation history, use [List Messages](/api-reference/ask/list-messages).

## Authentication

Requires an [API key](/authentication). The session is looked up within the key's project; an unknown session returns `404`. An end-user-scoped key can only retrieve its own sessions.

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

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.bota.dev/v1/ask/sessions/as_abc123', {
    headers: { 'Authorization': 'Bearer sk_live_...' },
  });

  const session = await response.json();
  ```

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

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

  session = response.json()
  ```
</RequestExample>

## Path Parameters

<ParamField path="id" type="string" required>
  Session identifier (`as_*`).
</ParamField>

## Response

Returns the session object.

<ResponseExample>
  ```json 200 theme={null}
  {
    "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"
  }
  ```
</ResponseExample>

## Response Fields

| Field                          | Type           | Description                                                                                                                                                                                                                                                                                 |
| ------------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                           | string         | Session identifier (`as_*`)                                                                                                                                                                                                                                                                 |
| `scope`                        | object         | `{ type, recording_ids, recording_title }`. `type` is `recording` / `library` / `selected` / `folder`; `recording_ids` lists the in-scope recordings (one for `recording`, the chosen set for `selected`, empty for `library`); `recording_title` is the cached title for `recording` scope |
| `title`                        | string         | Session title                                                                                                                                                                                                                                                                               |
| `message_count`                | integer        | Number of messages in the session                                                                                                                                                                                                                                                           |
| `last_message_at`              | string         | Timestamp of the most recent message                                                                                                                                                                                                                                                        |
| `last_model` / `last_provider` | string \| null | Model and provider of the last assistant turn                                                                                                                                                                                                                                               |
| `created_at` / `updated_at`    | string         | Timestamps                                                                                                                                                                                                                                                                                  |
