Skip to main content
Create additional outputs from a consultation, such as referrals and patient instructions. Each document has its own content and version. Scopes: scribe:write to create, edit, or delete; scribe:generate to generate content; scribe:read to retrieve results.

Create an empty document

POST /sessions/{session_id}/documents
Choose a template from document templates. title defaults to Document; omitting template_id uses Auto SOAP. The 201 response contains the document’s id, current_version: 1, empty rendered_text, and empty content. The new document is empty even if its status is ready. Generate content next.

Generate or regenerate content

Save the returned ID as CORTEXA_DOCUMENT_ID, then request content:
You can send {} to use the applicable language setting. The default response is 200 text/event-stream: append output.delta text for this document, then replace it with the saved document from output.ready. See Streaming for event handling and reconnecting without duplicate work. For background generation, add ?stream=false. The 202 JSON receipt contains job_id, status, and document_id; poll the job, then fetch the document. Use a new key when the clinician intentionally requests fresh content after a change to the session.

Read a document or list the session’s documents

GET /sessions/{session_id}/documents?page=1&per_page=20 lists documents using the standard paginated response.

Save an edit

Read the document first, retain its current_version, and send that value as base_version. The example assumes the version you just read was 1:
base_version is required. title, rendered_text, and content are optional editable fields. Retain the new current_version returned after saving. A stale base_version returns 409. Retrieve the latest document and resolve the edits before saving again.

Delete a document

DELETE /sessions/{session_id}/documents/{document_id} returns {"deleted": true} and makes that document unavailable to the partner. Deleting one document does not delete its session. To save a reviewed note in your EHR, use your EHR API or an approved connector. Use note sections to map consult-note headings to EHR fields. PDF and DOCX downloads are not exposed by these document endpoints.