CitaBox uses JWT bearer authentication. When you log in, the API returns a signed access token. You pass that token in anDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/FerchoSG/healthcare-web/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header on every subsequent request. A second header, x-clinic-id, tells the API which clinic’s data to scope the request to. Both values are managed automatically by the web app, and this page explains exactly how they work — useful if you are integrating with the API directly.
Login flow
POST credentials to /auth/login
Send your email and password to the login endpoint. This request does not require an
Authorization header.Receive the access token
A successful login returns an The web app stores the token in
access_token and the list of clinic memberships your account belongs to.localStorage under the key access_token using setAccessToken(). If the login response contains only one membership, that clinic is selected automatically. If there are multiple memberships, a clinic picker is shown.Pass the token in the Authorization header
Include the token as a The API client builds this header automatically from the in-memory
Bearer token in every authenticated request:accessToken value, falling back to localStorage.getItem("access_token") if the in-memory value is not set.User profile
After setting the clinic context, the app callsGET /auth/me to load the authenticated user’s full profile. The response shape is:
active_membership field reflects the clinic currently selected via x-clinic-id. The memberships array contains all clinics the user belongs to, which is used to populate the clinic picker.
Session expiry and automatic sign-out
Session expiry and automatic sign-out
CitaBox handles expired or invalid tokens automatically. When any API response returns an HTTP
401 Unauthorized status, the client calls clearAuth(), which removes both access_token and clinic_id from memory and from localStorage. The user is redirected to the login screen on the next render cycle.You do not need to implement token refresh logic. Simply catch the 401, clear local state, and prompt the user to log in again.CitaBox does not currently implement silent token refresh. If a session expires while the app is open, the user will be asked to log in again.
Switching between clinics
Switching between clinics
Users with multiple clinic memberships can switch clinic context at any time from the top header. Switching calls After switching, the user’s role may be different in the new clinic. The app updates the active view to match the default view for the new role (
setClinicId(newClinicId), which updates localStorage and the in-memory value, then refetches the user profile via GET /auth/me with the new x-clinic-id.dashboard for admins, front-desk for receptionist, schedule for doctors).Next steps
Quickstart
Walk through the full onboarding flow and create your first appointment.
API reference
Explore all available endpoints with request and response schemas.
Roles and dashboards
Understand how roles — ADMIN, STAFF, DOCTOR — map to views and permissions.
Online booking
Let patients book without an account using the public booking portal.