Appointments
Appointments are filtered by date range and status for the current branch scope.
The appointments model
Properties
- Name
id- Type
- string
- Description
Appointment UUID.
- Name
patientId- Type
- string
- Description
Optional linked patient.
- Name
doctorId- Type
- string
- Description
Assigned provider.
- Name
startTime- Type
- string
- Description
ISO start datetime.
- Name
status- Type
- string
- Description
Scheduled status enum.
GET/api/appointments
List appointments
Use startDate, endDate, status, patientId. pageSize defaults to all.
Query parameters
Query parameters: startDate, endDate, status, patientId.
Request
GET
/api/appointmentscurl -X GET http://localhost:3000/api/appointments \
-H "Authorization: Bearer YOUR_JWT"
Response
[
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"eventTime": "2026-10-05T06:30:00.000Z",
"durationMinutes": 30,
"status": "SCHEDULED",
"appointmentType": "CONSULTATION",
"patient": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"patientName": "Ahmad bin Ali"
},
"doctor": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"fullName": "Dr. Lee"
}
}
]
POST/api/appointments
Create appointment
Requires start time, duration, and doctor.
Request
POST
/api/appointmentscurl -X POST http://localhost:3000/api/appointments \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d "{\"startTime\":\"2026-10-06T09:00:00.000Z\",\"durationMinutes\":30,\"doctorId\":\"DOC_UUID\"}"
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"eventTime": "2026-10-05T06:30:00.000Z",
"durationMinutes": 30,
"status": "SCHEDULED",
"patientId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"doctorId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}
PATCH/api/appointments/:id
Update appointment
Reschedule or change status.
Request
PATCH
/api/appointments/:idcurl -X PATCH http://localhost:3000/api/appointments/:id \
-H "Authorization: Bearer YOUR_JWT"
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "CONFIRMED",
"eventTime": "2026-10-05T06:30:00.000Z"
}
GET/api/appointments/time-blocks
List time blocks
Provider unavailability / blocked slots.
Request
GET
/api/appointments/time-blockscurl -X GET http://localhost:3000/api/appointments/time-blocks \
-H "Authorization: Bearer YOUR_JWT"
Response
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"doctorId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"startTime": "2026-10-05T06:30:00.000Z",
"endTime": "2026-10-05T12:00:00.000Z",
"reason": "Lunch"
}
]
}
POST/api/appointments/time-blocks
Create time block
Block provider calendar time.
Request
POST
/api/appointments/time-blockscurl -X POST http://localhost:3000/api/appointments/time-blocks \
-H "Authorization: Bearer YOUR_JWT"
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"doctorId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"startTime": "2026-10-05T06:30:00.000Z",
"endTime": "2026-10-05T12:00:00.000Z"
}