Server-side APIEndpointsAppointments

Book an appointment

Book a visit for a patient, the way the clinic's front desk does in Medos.

Books a visit for a patient, as the clinic's own staff do in Medos: from a hospital system, a call-centre tool or your own scheduling screen. The booking appears on the clinic's calendar, and Medos sends the patient the same confirmations and reminders it sends for any staff booking.

API-key only, gated on devapi_appointments_book. Send X-Acting-User-Id to attribute the booking to a staff member. Without it, the booking is attributed to the workspace admin.

Parameters

Headers

x-api-keystringrequiredExample: mk_…

Your Developer API key. Server-side only.

X-Acting-User-IdstringExample: MDU_A1B2C3D4E5F6

The staff member the call is attributed to, as an MDU_… id. Omit it to attribute the call to the workspace admin.

Content-TypestringrequiredExample: application/json

The body is JSON. Anything else is a 415.

Body

patientIdintegerrequiredExample: 4821

The patient, from GET /v1/patients.

doctorIdstringrequiredExample: MDU_A1B2C3D4E5F6

The practitioner's MDU_… staff id, from GET /v1/doctors. Not a number.

addressIdintegerrequiredExample: 1

The location, from GET /v1/addresses.

mode"OFFLINE" | "ONLINE" | "HOME_VISIT" | "HOME_COLLECTION"enumrequired

How the visit happens.

fromDateTimeIsostringExample: 2026-11-20T10:00:00+05:30

A slot's start, exactly as GET /v1/doctors/{doctorId}/slots returns it. Required unless you book a token with sessionId and date.

toDateTimeIsostringExample: 2026-11-20T10:30:00+05:30

That slot's end.

sessionIdstringExample: 31

To book a token instead of a slot: a sessions[].sessionId from the practitioner's slots. Send with date, and without the two times.

datedateExample: 2026-11-20

With sessionId only: the session's day, YYYY-MM-DD.

consultationChargestringrequiredExample: 800

A decimal string, at most two places. Not a JSON number.

paymentModestringrequiredExample: CASH

One of the clinic's payment methods, e.g. CASH or UPI.

visitType"CONSULTATION" | "FOLLOW_UP" | "EMERGENCY" | "PROCEDURE" | "LAB_TEST" | "SURGERY" | "VIRTUAL" | "IN_PERSON"enum
appointmentNotesstring

Up to 500 characters.

chiefComplaintstring

Up to 500 characters.

  • Pick the time from the practitioner's slots. Call GET /v1/doctors/{doctorId}/slots for the day and send one slot's start and end as fromDateTimeIso and toDateTimeIso, unchanged. They are in the location's own offset, which is how Medos reads the clinic-local time. The same moment in another offset (in UTC, say) names a different local time and is refused.
  • Or book a token in a session. When the practitioner runs token sessions, their slots list them under sessions. Send a session's sessionId and the date instead of fromDateTimeIso and toDateTimeIso; sending both, or neither, is a 400 naming the fields. Medos gives the patient the next token, and the response carries it under queueToken: its number, display (C-013), the session and the patient's tracking link. The live estimate of when it will be seen is in search results. A sessionId that is not one of the practitioner's sessions at that location on that date is a 400 naming sessionId; a full or ended session is Medos's own 400.
  • doctorId is the MDU_… staff id from GET /v1/doctors. A number is a 400.
  • Use your own ids for the rest: patientId from GET /v1/patients, addressId from GET /v1/addresses.
  • consultationCharge is a decimal string, like all money in this API: "800" or "750.50".
  • paymentMode is one of the payment methods the clinic has set up in Medos, such as CASH or UPI. Medos refuses one it does not have.
  • The body is strict. A field this route does not know is a 400 naming it, so nothing is silently dropped. Packs, discounts and online payment are not part of this route.

Responses

The 201 carries Location: /v1/appointments/SCHEDULED:<id>, and the body is the appointment in the same shape as GET /v1/appointments/{appointmentRef}. Medos marks the booking as made through the Developer API.

One call, one booking

Each successful call books a new appointment. If a request times out, search the patient's appointments for that day before you retry.

Test request