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

# Visits

> One consultation: its statuses, idempotency, recordings, templates and the note.

A **visit** is one consultation with a patient — the same record the app creates when a clinician records. You
create it with a transcript or a recording; RxNote transcribes the recording, writes the note and, if asked, a
summary.

## Statuses

The status is the visit's processing status exactly as the app shows it.

```mermaid theme={null}
stateDiagram-v2
  [*] --> recording: created with audio
  [*] --> processing: created with transcript
  recording --> processing: process
  processing --> transcribing
  transcribing --> generating_soap
  processing --> generating_soap: transcript given
  generating_soap --> completed
  transcribing --> no_speech
  transcribing --> failed
  generating_soap --> failed
```

| Status | Meaning |
| - | - |
| `recording` | Created with `audio`; upload the file and call process. Removed if nothing arrives within 6 hours. |
| `pending` | Waiting to be handed to a worker. |
| `processing` | Handed to a worker. |
| `transcribing` | Turning the recording into text. |
| `generating-soap` | Writing the note (and summary). |
| `completed` | Everything requested is ready. |
| `no-speech` | The recording had no usable speech; no note was written. |
| `failed` | See `error.code`: `TRANSCRIPTION_FAILED`, `NOTE_FAILED` or `TIMED_OUT`. |

Most notes complete within one to three minutes.

## Idempotency

`POST /visits` requires an `Idempotency-Key` header — your own unique id for the consultation, such as your
appointment id. Sending the same key and body again returns the same visit instead of creating a second one, so
retrying after a timeout or a 5xx is always safe. The same key with a different body fails with
`409 IDEMPOTENCY_CONFLICT`.

## Outputs

`outputs` chooses what to produce: any of `transcript`, `note`, `summary`. The default is `["transcript", "note"]`.
Send `["transcript"]` for transcription only. Fields you did not ask for are left out of the response; fields not
ready yet are `null`.

## Clinicians

With a personal key, the visit is the key owner's. With an organization key, `clinician_email` is required and must
belong to a member of the organization. Either way the note uses that clinician's templates and preferences, and the
visit appears in their RxNote patient list.

## Templates

`GET /templates` returns the templates the clinician can pick in the app. Pass `template_id` to choose one; without
it, the clinician's default template is used.

## The note

```json theme={null}
{
  "template": { "id": 12, "name": "General OPD" },
  "framework": "soap",
  "sections": [
    {
      "id": "subjective",
      "title": "Subjective",
      "fields": [
        { "id": "chief_complaint", "label": "Chief complaint", "text": "Sore throat for three days." }
      ]
    }
  ],
  "html": "<h2>Subjective</h2>..."
}
```

Sections and fields come in template order. Their `id`s are stable even if a label is renamed, so map fields into
your system by `id`. Use `html` to show the note as written. If the clinician edits the note in RxNote,
`GET /visits/{id}` returns the edited note.

To rewrite the note, write more notes from the visit (a progress note, a letter) or draw its ICD codes, see
[Notes and codes](/notes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.