Server-side API

Developer API quickstart

From nothing to a successful API call in about two minutes.

The shortest path to a 200. Every step is explained properly in Authentication; this page just gets you there.

1. Find your server's public address

The key will only work from the addresses you register, so start there. From the server that will call Medos (not your laptop), run:

curl -s https://checkip.amazonaws.com

That is the address your requests leave from. Behind a NAT gateway or a load balancer it is often not the server's own address. See IP allowlist if you are unsure.

2. Create the key

In the dashboard, Workspace Settings → API Keys → Add API Key:

Set Key Type to Developer API.
Add the address from step 1 under Allowed IP addresses.

Create the key and copy the API key (mk_…). It is shown in full once, so put it straight into your secret manager.

3. Call the API

List the clinic's locations. It needs no parameters and reads no patient data:

curl -s "https://api.medos.one/v1/addresses" \
  -H "x-api-key: $MEDOS_API_KEY"

Or from Node:

const res = await fetch("https://api.medos.one/v1/addresses", {
  headers: { "x-api-key": process.env.MEDOS_API_KEY },
});

console.log(res.status, await res.json());

A 200 with your locations under content means everything is wired up: the key is live, your server's address is on its allowlist, and your plan includes the Developer API.

What just happened

Three things had to be true:

x-api-keyA live Developer API key
Your source IPOn that key's allowlist
Your planIncludes devapi_catalog_addresses, see Entitlements

Next: read a patient

curl -s "https://api.medos.one/v1/patients?mrn=MRN-0774" \
  -H "x-api-key: $MEDOS_API_KEY"

An identifier lookup returns a page with zero or one patient. From the patient's id you can read their visits, prescriptions and documents.

If it didn't work

Errors are problem details. Branch on code:

StatuscodeMost likely
401UNAUTHENTICATEDThe key is wrong, deactivated, or is an SDK widget key rather than a Developer API key
403IP_NOT_ALLOWEDYour server's address isn't on the allowlist. detail names the address it saw
403FEATURE_NOT_ENTITLEDYour plan doesn't include this route. requiredFeature says which item
429RATE_LIMITEDYou're over the rate limit; back off for Retry-After seconds

Next

On this page