Appointments API
The Appointments API is used to create patient appointments with doctors and departments.
Backend folder:
app/appointments/
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| 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
| Field | Type | Description |
|---|---|---|
type | string | Appointment type, such as OPD |
status | string | Appointment status |
patient_id | UUID | ID of the patient |
doctor_id | UUID | ID of the doctor |
department_id | UUID | ID of the department |
schedule | datetime | Date and time of the appointment |
is_follow_up | boolean | Shows whether the appointment is a follow-up visit |
expected_duration_minutes | number | Expected 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_iddoctor_iddepartment_idscheduletypestatus
All ID values must be UUID strings.
The schedule field uses datetime format.
Example:
2026-05-26T23:05:28.784335
Possible Responses
| Status Code | Meaning |
|---|---|
| 200 | Appointment created successfully |
| 201 | Appointment created successfully |
| 400 | Invalid request data |
| 401 | Not authenticated |
| 403 | Permission denied |
| 404 | Patient, doctor, or department not found |
| 422 | Validation error |