Server-side API

Entitlements

Which routes your API key can call, how access is granted, and what a 403 with requiredFeature means.

Every Developer API route is gated on your workspace's plan, one feature item per operation. Reading the roster and reading one patient are separate grants; so are reading a prescription and downloading its PDF.

This is not a scope you set on the key. It is granted on the Medos side, per workspace, and takes effect without you changing anything.

When you are not entitled

403, as a problem document:

{
  "type": "https://docs.medos.one/errors/feature-not-entitled",
  "title": "Feature not entitled",
  "status": 403,
  "detail": "This workspace's plan does not include devapi_patients_list. Contact your medos administrator to enable it.",
  "instance": "/v1/patients",
  "code": "FEATURE_NOT_ENTITLED",
  "requestId": "01JCX6Q4W3J7N8Y2H5K9M1B0VD",
  "requiredFeature": "devapi_patients_list"
}

Branch on code and read requiredFeature; detail is for a human reading a log. A FEATURE_NOT_ENTITLED means this workspace has not been granted this operation. It does not mean your key is wrong (401 UNAUTHENTICATED), your address is unlisted (403 IP_NOT_ALLOWED), or the route does not exist (403 ROUTE_NOT_AVAILABLE).

The feature items

RouteFeature item
GET /v1/patients with mrn, email or phoneNumberdevapi_patients_lookup
GET /v1/patients without any of thosedevapi_patients_list
GET /v1/patients/{patientId}devapi_patients_get
GET /v1/patients/{patientId}/visitsdevapi_patients_visits
GET /v1/patients/{patientId}/vitalsdevapi_patients_vitals
GET /v1/patients/{patientId}/medical-historydevapi_patients_medical_history
POST /v1/patientsdevapi_patients_upsert
GET /v1/appointments/{appointmentRef}devapi_appointments_get
POST /v1/appointments/searchdevapi_appointments_search
GET /v1/patients/{patientId}/prescriptionsdevapi_patients_prescriptions_list
GET /v1/prescriptions/{id}devapi_prescriptions_get
GET /v1/prescriptions/{prescriptionId}/pdfdevapi_prescriptions_pdf
GET /v1/patients/{patientId}/documentsdevapi_patients_documents_list
GET /v1/addressesdevapi_catalog_addresses
GET /v1/doctorsdevapi_catalog_doctors

The roster is granted separately, on purpose

GET /v1/patients is one route with two grants. With an identifier it answers about one patient you already know; without one it can walk the whole clinic. Those carry very different risk, so expect the roster to be refused even where lookup is allowed. Which grant a request needs is decided by its query alone: countryCode without phoneNumber is still a roster request.

Getting an operation enabled

Ask whoever administers your Medos plan. They grant it per workspace, so enabling patient lookup for you does not enable it for every clinic on the same plan.

Two things worth knowing about the timing:

  • A grant reaches the API within about ten minutes. There is a cache, so a change is not instant, but it never needs a deploy. If you are testing a grant and still seeing 403, waiting is usually the answer.
  • A workspace with no active subscription behaves as if nothing is enabled. If every call starts answering FEATURE_NOT_ENTITLED at once, check the subscription before checking the grants.

Rate limits are a different thing

Entitlement says whether you may call a route. Rate limits say how often. They are enforced independently. A 429 is never an entitlement problem, and the rate limit is checked first, so a run of 429s does not tell you anything about your grants.

On this page