Skip to main content

Appointments API

The Appointments API is used to create patient appointments with doctors and departments.

Backend folder:

app/appointments/

Endpoints

MethodEndpointDescription
POST/appointment/Create appointment

Create Appointment

POST /appointment/

Creates a new appointment record.

Request Body

{
"type": "OPD",
"status": "SCEDULED",
"patient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"doctor_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"department_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"schedule": "2026-05-26T23:05:28.784335",
"is_follow_up": false,
"expected_duration_minutes": 15
}

Field Notes

FieldTypeDescription
typestringAppointment type, such as OPD
statusstringAppointment status
patient_idUUIDID of the patient
doctor_idUUIDID of the doctor
department_idUUIDID of the department
scheduledatetimeDate and time of the appointment
is_follow_upbooleanShows whether the appointment is a follow-up visit
expected_duration_minutesnumberExpected appointment duration in minutes

Response Example

{
"id": "8c6b2f4d-31b1-4d6a-93c6-b5e97df8b201",
"type": "OPD",
"status": "SCEDULED",
"patient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"doctor_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"department_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"schedule": "2026-05-26T23:05:28.784335",
"is_follow_up": false,
"expected_duration_minutes": 15
}

Notes

An appointment connects:

  • patient_id
  • doctor_id
  • department_id
  • schedule
  • type
  • status

All ID values must be UUID strings.

The schedule field uses datetime format.

Example:

2026-05-26T23:05:28.784335

Possible Responses

Status CodeMeaning
200Appointment created successfully
201Appointment created successfully
400Invalid request data
401Not authenticated
403Permission denied
404Patient, doctor, or department not found
422Validation error