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

# Generate notes

`POST /api/v1/notes`

Generate a structured clinical note. Two input modes:

* **Audio** — multipart with a `file`. Transcribes then generates.
* **Transcript** — JSON with a `transcript`. Generates from text.

## Request — audio (multipart/form-data)

| Field               | Required | Notes                                     |
| ------------------- | -------- | ----------------------------------------- |
| `file`              | yes      | Audio file.                               |
| `language`          | no       | Output language. Default `sv`.            |
| `templateSections`  | no       | JSON template structure (string).         |
| `template`          | no       | Registered template id.                   |
| `sideNote`          | no       | Extra context appended before generation. |
| `primaryProfession` | no       | Profession context.                       |
| `customTemplate`    | no       | Free-form custom template body.           |

## Request — transcript (application/json)

```json theme={null}
{
  "transcript": "Patienten söker för...",
  "language": "sv",
  "templateSections": "[{\"sectionName\":\"Anamnes\",\"aiRules\":{\"autoFill\":true}}]",
  "primaryProfession": "physician"
}
```

## Response

```json theme={null}
{
  "transcript": "...",
  "note": {
    "cause": "Reason for visit",
    "subjective": "...",
    "objective": "...",
    "assessment": "...",
    "plan": "...",
    "diagnoses": ["**I10** Hypertoni [[ICD-10]]"],
    "coding_codes": [
      { "code": "I10", "system": "ICD-10", "description": "Hypertoni" }
    ],
    "tasks": {
      "0": { "title": "...", "category": "...", "priority": "high", "description": "..." }
    },
    "sections": [
      { "sectionName": "Anamnes", "content": "..." }
    ],
    "combined": "Full note rendered as text"
  }
}
```

Field set varies with the template used. When you pass `templateSections`, the
`sections` array mirrors your structure. The `combined` field is always a full
text rendering you can drop straight into an EHR text area.

## Errors

| Status | Reason                                            |
| ------ | ------------------------------------------------- |
| 400    | Neither a `file` nor a `transcript` was provided. |
| 401    | Invalid API key.                                  |
| 502    | Upstream generation failed.                       |
