Get started
Quickstart
From zero to your first answer from DoctorX in about five minutes. No coding experience needed for steps 1 to 4.
Sign in to DoctorX
Open DoctorX and sign in with your normal clinic account. Admins, doctors and receptionists can all create keys; each key can only do what its creator is allowed to do.
Open API & integrations
Click your name in the top-right corner, choose Settings, then the API & integrations tab. Or go straight there: Settings → API & integrations.
Create a key
Click New key and fill in three things:
- Name: where you'll use it, e.g. “Website booking”. This helps you recognise it later.
- Scopes: what the key may do. For this guide keep the two that are already ticked,
patients:readandappointments:read. What each scope means. - Expires: when the key stops working on its own. 90 days is a good default.
Click Create key.
Copy the key and keep it safe
You'll see a long code starting with
hfk_. Click Copy and paste it somewhere safe, like a password manager.The key is shown only once
DoctorX keeps only a fingerprint of it, so nobody (not even us) can show it again. Lost it? Revoke it and make a new one; it takes ten seconds. Treat the key like the clinic's front-door key: never paste it into chats, emails, screenshots or website code that visitors can see.Make your first request
Pick the language you use, copy the example, and replace
YOUR_API_KEYwith your key. (In the JavaScript, Python and PHP versions the key is read from an environment variable calledDOCTORX_API_KEY, which keeps it out of your code.)bashcurl "https://your-healthfix-site/api/v1/patients?limit=5" \ -H "Authorization: Bearer YOUR_API_KEY"What each part of the curl command means:
Part What it does curlA small program, already on Mac, Linux and Windows 10+, that sends web requests from the terminal. /api/v1/patientsWhich data you want. Here: the list of patients. Every address is listed in the API reference. ?limit=5An option: only return 5 patients. Authorization: Bearer …Your key. “Bearer” just means “the person holding this key”. Always send it this way. Read the answer
DoctorX answers in JSON, a plain-text format every language understands. The data you asked for is always inside
data:json{ "data": [ { "id": "0b9f6f7e-3c1a-4f7e-9b1e-5f2d8a7c1e42", "patient_code": "CHC000123", "full_name": "Ravi Kumar", "gender": "male", "date_of_birth": "1985-06-14", "phone": "9876501234", "last_visit": "2026-09-12", "visit_count": 4, "created_at": "2026-03-02T10:15:00Z" } ], "meta": { "has_more": true, "next_cursor": "MjAyNi0wMy0wMlQxMDoxNTowMFp8MGI5ZjZm..." } }meta.has_moretells you there are more patients; ask for the next page with?cursor=and thenext_cursorvalue. If something goes wrong you get anerrorinstead, with a plain-English message. See errors.Optional: create something
Reading is done. To add a patient, create a key that also has
patients:write, then send aPOSTwith the patient's details:bashcurl -X POST "https://your-healthfix-site/api/v1/patients" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"full_name": "Asha Verma", "gender": "female", "phone": "9876543210"}'You get back the new patient, including the patient ID DoctorX assigned. They appear in the app immediately.
Where to go next#
- API reference: every endpoint, what it needs and what it returns.
- Recipes: website booking, Google Sheets, WhatsApp bots and more, step by step.
- AI assistants: connect Claude, Cursor or VS Code without writing code.
Stuck? Troubleshooting lists the usual fixes.