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

# Quickstart — Asynchronous AI Scribe

> Build an asynchronous ambient scribe on the Medera API

For workflows where the encounter audio is recorded first and processed later (after-hours batch, video uploads), use the async pipeline.

## 1. Upload the recording

```bash theme={"system"}
curl -X POST https://api.medera.info/api/sessions/{id}/recordings \
  -H "Authorization: Bearer $TOKEN" \
  -F "audio=@encounter.wav"

```

Limits: 60 minutes per recording, 150 MB max, 16 kHz PCM or 22.05 kHz Opus.

## 2. Trigger the transcript

```bash theme={"system"}
curl -X POST https://api.medera.info/api/sessions/{id}/transcripts \
  -H "Authorization: Bearer $TOKEN" \
  -d '{ "diarization": true, "language": "en-US" }'

```

Returns a `transcript_id` and a status of `processing`.

## 3. Poll for completion

```bash theme={"system"}
curl https://api.medera.info/api/sessions/{id}/transcripts/{transcript_id}/status \
  -H "Authorization: Bearer $TOKEN"

```

Status transitions: `processing` → `completed` | `failed`.

## 4. Generate the document

```bash theme={"system"}
curl -X POST https://api.medera.info/api/textgen/documents \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "template_key": "soap_outpatient_bh",
    "session_id": "ses_abc",
    "transcript_id": "tx_xyz"
  }'

```

Returns a draft note ready for clinician review.

## Recommended for

* Overnight batches of telehealth recordings

* Post-visit document regeneration with updated templates

* Episode-level discharge summary generation
