Skip to main content
This quickstart makes six calls with made-up data: it checks your key, creates a fake patient, writes a short note for them, reads it back and then deletes the patient. Run it in a test organization, not in the organization that holds your real patients.
Step 4 generates a real note and uses one Scribe session from the organization’s plan. Every other step is free.

Before you start

  1. An org admin opens Account Settings → API Keys at app.healos.ai/account-settings in the test organization and creates a key with these scopes: patients:read, patients:write, notes:read, notes:write.
  2. Copy the key (it starts with hlsk_ and is shown only once) and keep it in an environment variable, not in your code:

Steps

1

Check which organization the key acts in

Expect 200 with data.org.name set to your test organization and the four scopes above. If it names your live organization, stop and create a key in the test organization instead.
2

Create a fake patient

Expect 201 with the new patient in data. Copy data.id (a numeric string) into PATIENT_ID:
Running this again returns 409 with existing.id, because external_id must be unique in the organization. Use that id.
3

Find the patient by your own id

Expect 200 with a one-item data array. This is how you look up records without storing HealOS ids.
4

Generate a note from text

Expect 202 with data.session_id and data.status: "queued". Copy the session id:
5

Read the note

Expect 200. data.notes is empty while the note is being written and holds the note within about a minute. Repeat the call every 10 seconds until it appears. In production, use a NOTE_CREATED webhook instead of polling.
6

Clean up

Expect 200 with { "success": true }. This permanently deletes the fake patient with its session and note.

Expected outcomes

The same flow as a script

The same six calls in JavaScript and Python. Both read the key from the HEALOS_API_KEY environment variable and use only made-up data.
  • JavaScript: save as quickstart.mjs and run it with Node.js 18 or later: HEALOS_API_KEY=hlsk_... node quickstart.mjs.
  • Python: install requests (pip install requests), save as quickstart.py and run it with Python 3.8 or later: HEALOS_API_KEY=hlsk_... python quickstart.py.
Both scripts send the note request once and never retry it: each call to POST /notes/from-text creates a new note and uses a Scribe session. See Going to production for safe retries.

Next steps

Recipes

Complete tasks, step by step.

Making requests

Pagination, external_id and responses.

Error catalog

Every status and what to do.