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

# Sessions (chunked)

For streaming audio in chunks. See the [chunked flow guide](/guides/chunked)
for the end-to-end walkthrough.

## Open a session

`POST /api/v1/sessions`

```json theme={null}
{ "sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }
```

## Upload a chunk

`POST /api/v1/sessions/{sessionId}/chunks` — multipart/form-data

| Field      | Required | Notes         |
| ---------- | -------- | ------------- |
| `file`     | yes      | Audio chunk.  |
| `language` | no       | Default `sv`. |

```json theme={null}
{ "ok": true, "chunkTranscript": "..." }
```

Each chunk's text is appended to the session transcript.

## Generate from session

`POST /api/v1/sessions/{sessionId}/notes` — application/json

Accepts the same metadata fields as [Generate notes](/api/notes)
(`language`, `templateSections`, `template`, `sideNote`, `primaryProfession`,
`customTemplate`).

```json theme={null}
{
  "transcript": "...full accumulated transcript...",
  "note": { "cause": "...", "subjective": "...", "...": "..." }
}
```

Generating consumes the session. Open a new one for the next consultation.

## Errors

| Status | Reason                                                    |
| ------ | --------------------------------------------------------- |
| 400    | No chunk provided / no audio accumulated for the session. |
| 401    | Invalid API key.                                          |
| 502    | Upstream failure.                                         |
