Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bentlyy/Clinica/llms.txt

Use this file to discover all available pages before exploring further.

Each doctor in Clinica has a weekly availability schedule that controls when patients can book appointments. Availability is defined per day of the week, with a start time and an end time. Doctors can also create exceptions to block a full day or a specific time range on a particular date — for example, to mark a holiday or a break. Patients can query any doctor’s availability without authentication. Managing availability (creating or deleting windows) requires a logged-in doctor account.

Day of week mapping

The day_of_week field uses JavaScript’s Date.getDay() convention:
ValueDay
0Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday

View a doctor’s availability

Returns all weekly availability windows for a specific doctor, ordered by day and start time. This endpoint is public — no token required.
curl http://localhost:3000/api/availability/5
Replace 5 with the doctor’s ID. Response
[
  {
    "id": 1,
    "doctor_id": 5,
    "day_of_week": 1,
    "start_time": "09:00:00",
    "end_time": "17:00:00"
  },
  {
    "id": 2,
    "doctor_id": 5,
    "day_of_week": 3,
    "start_time": "09:00:00",
    "end_time": "13:00:00"
  }
]
This tells you that doctor 5 is available on Mondays from 09:00 to 17:00, and on Wednesdays from 09:00 to 13:00.

Add an availability window (doctors only)

Authenticated doctors can define a new weekly availability window. The doctor_id is taken from your token — you do not supply it in the request body.
curl -X POST http://localhost:3000/api/availability \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "day_of_week": 1,
    "start_time": "09:00",
    "end_time": "17:00"
  }'
Body parameters
FieldRequiredDescription
day_of_weekYesInteger from 0 (Sunday) to 6 (Saturday).
start_timeYesWindow start in HH:MM format. Must be earlier than end_time.
end_timeYesWindow end in HH:MM format. Must be later than start_time.
Response
{
  "id": 1,
  "doctor_id": 5,
  "day_of_week": 1,
  "start_time": "09:00:00",
  "end_time": "17:00:00"
}
The API rejects the request if the new window overlaps with an existing availability window for the same day.

Delete an availability window (doctors only)

Remove a specific availability window by its ID. You can only delete your own windows.
curl -X DELETE http://localhost:3000/api/availability/1 \
  -H "Authorization: Bearer <token>"
Response
{ "message": "Availability deleted" }

How exceptions affect bookings

Beyond the weekly schedule, doctors can block out specific dates using exceptions. An exception can cover a full day or a specific time range within a day. When a patient queries available slots or tries to create a booking:
  • If a full-day exception exists for that date, no slots are available regardless of the weekly schedule.
  • If a time-range exception exists, any slot that overlaps with the blocked range is excluded.
Exception management is handled through the doctor’s admin interface and is not exposed as a patient-facing API. The effects of exceptions are visible when you query available slots via GET /api/bookings/available-slots.

Build docs developers (and LLMs) love