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

# Create Session

> Start a multi-turn chat session over your collections.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.doctly.ai/api/v1/chat/sessions \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"collection_ids": ["8f14e45f-ceea-467f-a34e-cbb17b0dbe1b"]}'
  ```
</RequestExample>

**POST** `/api/v1/chat/sessions`

Creates a chat session bound to one or more collections. Sessions preserve conversation history: each [message](/api-reference/chat/send-message) is answered with the prior turns as context.

Sessions created with an API key belong to your account and are visible to all keys in the account.

## Request

<ParamField body="collection_ids" type="string[]" required>
  Collections used for retrieval in this session.
</ParamField>

<ParamField body="title" type="string">
  Optional session title. When omitted, a title is generated from the first exchange.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Server-generated session ID. Use it for all subsequent calls.
</ResponseField>

<ResponseField name="title" type="string">
  Session title.
</ResponseField>

<ResponseField name="collection_ids" type="string[]">
  The session's collections.
</ResponseField>

```json Response theme={null}
{
  "id": "b31c9a52-4a86-4dd7-9f2e-1c2d3e4f5a6b",
  "title": "New Chat",
  "collection_ids": ["8f14e45f-ceea-467f-a34e-cbb17b0dbe1b"],
  "created_at": "2026-07-30T02:10:00Z",
  "updated_at": "2026-07-30T02:10:00Z"
}
```
