The basics
- Send and receive JSON. For calls with a body set
content-type: application/json. The body can be up to 1 MB. - Paths are listed on each page. Everything signed-in lives under
/v1; the only other path isGET /healthz. - Ids are 24-character text strings. Order numbers are text such as
122703. - Dates are ISO 8601 text in UTC, for example
2026-11-23T12:26:00.329Z. A few fields are display text for people, such as the orderdate(Nov 15); they are named in the page where they appear. - Money is a number in US dollars with up to two decimals, for example
98.29.
The response envelope
A successful call returns a JSON object. The result is in data. A list also has meta with paging and counts. Some calls return no body at all and answer 204.
{
"data": [ { "id": "6aeb0da3503a52507f605eaa", "name": "Grace Lin" } ],
"meta": { "page": 1, "limit": 25, "total": 9 }
}A failed call returns an error object instead. See Errors for every code.
Paging
Lists of patients, orders and catalog offers are paged with two query parameters, and the reply's meta repeats them with the total number of matches.
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | The page to return, starting at 1. |
limit | integer | 25 | How many items per page, from 1 to 100. |
Other lists (providers, pharmacies, notifications, clinics) return everything that matches in one reply, with no paging.
Sandbox and production
Orders and notifications exist in two separate environments. Choose one for each call with the x-hrx-env header.
| Header value | Meaning |
|---|---|
staging | The sandbox. Orders you place here are test orders and are not sent to a pharmacy. |
production or no header | Your real data. Any value other than staging means production. |
An order placed in the sandbox cannot be seen from production, and the other way round: asking for it in the wrong environment returns 404. Patients, providers, clinics and the catalog are the same in both environments.
Choosing a clinic
Patients, providers and orders belong to a clinic. Which clinic a call works on depends on who you are.
- A clinic user works on their own clinic. Nothing else is visible.
- A person who works in an organization sees all the clinics beneath it together when reading. To work inside one clinic or sub-organization, send
x-clinic-idwith its id. A value that is not yours is ignored and you stay in your own scope. - Writing needs a clinic. In an organization's scope a write returns
400with the codepickClinic: choose a clinic withx-clinic-idfirst. - A super admin can work on any clinic. Send
x-clinic-id, or add?clinicId=to the address. A super admin who writes without choosing a clinic gets400with the codeclinicRequired. When creating a patient, provider or order, the body can also carryclinicId.
curl -b cookies.txt -H "x-clinic-id: CLINIC_ID" "https://app-api.homelyrx.com/v1/patients"Cross-origin calls
The API allows cross-origin browser calls with credentials only from the HomelyRx web app. Call it from your own server, where this does not apply. See Authentication for how to keep the session on a server.
