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

# Update Session

> Rename an AI Ask session

Update a session's title.

## 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 update its own sessions.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.bota.dev/v1/ask/sessions/as_abc123" \
    -H "Authorization: Bearer sk_live_..." \
    -H "Content-Type: application/json" \
    -d '{ "title": "Weekly commitments" }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.bota.dev/v1/ask/sessions/as_abc123', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer sk_live_...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ title: 'Weekly commitments' }),
  });

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

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

  response = requests.patch(
      'https://api.bota.dev/v1/ask/sessions/as_abc123',
      headers={
          'Authorization': 'Bearer sk_live_...',
          'Content-Type': 'application/json',
      },
      json={'title': 'Weekly commitments'},
  )

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

## Path Parameters

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

## Request Body

<ParamField body="title" type="string" required>
  New session title (1–200 characters).
</ParamField>

## Response

Returns the updated [session object](/api-reference/ask/get-session#response).

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "as_abc123",
    "scope": { "type": "library", "recording_ids": [], "recording_title": null },
    "title": "Weekly commitments",
    "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:25:10Z"
  }
  ```
</ResponseExample>
