Server-side APIEndpoints

Endpoints

The twenty-four routes a Developer API key can call, one page each.

The Developer API is a hospital records API: fifteen reads and nine writes: the patient upsert, recording vitals, replacing a medical history, booking, rescheduling, updating the status of and cancelling an appointment, and adding and updating staff. Each route has its own page covering what it is for, every parameter, the response, and the mistakes that produce a 400.

What every request needs

x-api-key: mk_…
X-Acting-User-Id: MDU_A1B2C3D4E5F6   # optional, on any route

The API key is the credential, so it belongs on your server and nowhere else. Requests are refused unless they come from an address on the key's IP allowlist. X-Acting-User-Id is optional everywhere. It names the staff member the call belongs to; see Acting user.

Two things are decided for you and cannot be sent:

  • workspaceId comes from the key. Every route is scoped to the workspace the key belongs to. A workspaceId in a query string is a 400, because no route accepts one, and in the search body it is a 400 too.
  • The identity Medos sees. The gateway calls the Medos core as your workspace's admin, or as the acting user when you name one.

Every route is also entitlement-gated on its own feature item, and follows the shared conventions: paging, ids, dates, money, and errors as RFC 9457 problem details.

This list is the whole surface

API keys can call these twenty-four routes and no others. Any other /v1 path is a 403 ROUTE_NOT_AVAILABLE, any /v2 path is a 404, and a listed path called with the wrong method is a 405 with an Allow header. Patient self-booking, OTP, payments, session packs and the other widget features are not part of the Developer API. They run in the widgets on a patient's own session.

Patients

MethodPathWhat it does
GET/v1/patientsLook a patient up by MRN, email or phone, or page through the roster
GET/v1/patients/{patientId}One patient record
GET/v1/patients/{patientId}/visitsVisit history with the clinical summary
GET/v1/patients/{patientId}/vitalsRecorded vitals, newest first
POST/v1/patients/{patientId}/vitalsRecord one vitals reading
GET/v1/patients/{patientId}/medical-historyAllergies, chronic conditions, surgical history
PUT/v1/patients/{patientId}/medical-historyReplace that history from your system
POST/v1/patientsCreate or update a patient from your system

Appointments

MethodPathWhat it does
GET/v1/appointments/{appointmentRef}One appointment
POST/v1/appointments/searchAppointments in a date window, filtered
POST/v1/appointmentsBook an appointment
PUT/v1/appointments/{appointmentRef}/rescheduleMove an appointment to a new time
PUT/v1/appointments/{appointmentRef}/statusMark it in consultation, completed or a no-show
DELETE/v1/appointments/{appointmentRef}Cancel an appointment (it is deleted and marked CANCELLED)

Clinical records

MethodPathWhat it does
GET/v1/patients/{patientId}/prescriptionsA patient's prescriptions
GET/v1/prescriptions/{id}One prescription
GET/v1/prescriptions/{prescriptionId}/pdfThe rendered prescription as a PDF
GET/v1/patients/{patientId}/documentsA patient's documents and their metadata

Staff

MethodPathWhat it does
POST/v1/staffAdd a staff member to your workspace, with their public profile
PUT/v1/staff/{staffId}Change their details, role or public profile

Reference data

MethodPathWhat it does
GET/v1/addressesThe clinic's locations
GET/v1/doctorsThe clinic's practitioners
GET/v1/doctors/{doctorId}/slotsOne practitioner's open and taken slots on a day
GET/v1/appointment-configsEach practitioner's hours, slot length, modes and fees, by location

The first two are the lookup tables every other response points into: a record's location.id resolves against GET /v1/addresses, and its practitioner.id against GET /v1/doctors. Those two are cacheable for five minutes; everything else, slots included, is Cache-Control: no-store. See Polling and caching.

On this page