1
Create the patient
201. Save data.id as PATIENT_ID. If the patient already
exists, you get 409 with existing.id; use that.2
Upload the document
Send the file as Expect
multipart/form-data. PDF, JPEG, PNG and DOCX up to 10 MB
are accepted, and the content must match the file extension.201, data.status: "pending" and a message that ends in
“text extraction started”. If message doesn’t mention extraction,
start it yourself with
POST .../documents/{documentId}/extract.3
Wait for text extraction
Register a Expect
DOCUMENT_STATUS_CHANGED webhook, or poll every
few seconds:data[0].status to move from pending to processing to
completed, with has_extracted_text: true. On failed, read
extraction_error.4
Generate the note
202 with data.session_id. Save it as SESSION_ID.5
Read the note
Wait for a Expect
NOTE_CREATED webhook, or poll every 10 seconds:200. data.notes is empty until the note is written, then
holds it with its content and codes.The same flow in Python
The steps above as one script, using requests (pip install requests). It
reads the key from HEALOS_API_KEY and expects a test file holding only
made-up details next to it.
document_to_note.py
DOCUMENT_STATUS_CHANGED and NOTE_CREATED webhooks.

