Skip to main content
Add patient history, reports, and previous consultation notes before generation. Scopes: scribe:write to change context; scribe:read to retrieve it.

Add background text

Set background_context when creating a session, or update it with PATCH /sessions/{session_id}:
Send the complete background text, up to 100,000 characters. PATCH replaces the existing value.

Upload a report

POST /sessions/{session_id}/context-documents accepts multipart form data. Use the field name files for each file and an Idempotency-Key for the upload.
Use a local file containing synthetic clinical information. For multiple files, repeat --form 'files=@...'; do not set the multipart boundary yourself. The 201 response contains an items array. Each item identifies an attachment: id, name, mime_type, size_bytes, status, and index_status. The upload response does not mean extraction and indexing have finished.

Wait for usable context

The response is paginated. Wait for both status: "ready" and index_status: "ready" on each required attachment before generating. These fields also show extraction or indexing failures.

Remove an attachment

DELETE /sessions/{session_id}/context-documents
Replace the illustrative ID with one returned by the attachment list. The response is {"deleted": true}. This detaches the files from the session; it does not delete the clinician’s library copy or rewrite existing generated notes. Use PUT /sessions/{session_id}/context/sessions to choose previous consultations whose notes provide context for future generation:
Choose up to 20 other sessions for the same patient and grant. Each source needs a completed consult note. The response and corresponding GET return the linked session IDs. Each generation reads the latest completed consult note from each linked session, including saved edits. You do not need to link the session again after editing or generating a new source note. An empty list removes every link. Linked notes can be used without new audio; any active or failed transcription must still be resolved. Generation skips deleted or inaccessible sources and uses the latest remaining completed note. Moving a source to another patient excludes it. Context changes apply to future generation; existing documents keep their text. A different patient returns 422 CONTEXT_PATIENT_MISMATCH; a resource outside the grant returns 404; a source without a completed note returns 409 CONSULT_NOTE_REQUIRED. Updates are atomic: an invalid source leaves the previous links in place. Continue with consult notes or documents.