This document describes the available API endpoints for the Healr backend. All endpoints are prefixed with /api/.
- Description: Register a new user (patient, doctor, or admin).
- Body Parameters:
name(string, required)email(string, required)password(string, required)role(string, required: 'patient', 'doctor', or 'admin')- (Doctor only)
gender,specialization,highestDegree,experience,fee,waitTime,numberOfPatients,location
- Responses:
201 Created:{ message, user|doctor|admin }400 Bad Request:{ error }500 Internal Server Error:{ error }
- Description: Login as patient, doctor, or admin.
- Body Parameters:
email(string, required)password(string, required)accountType(string, optional: 'patient', 'doctor', 'admin')
- Responses:
200 OK:{ message, user|doctor|admin }or{ message, user, doctor, hasBothAccounts }400 Bad Request:{ error }500 Internal Server Error:{ error }
- Description: Get all doctor accounts.
- Responses: Array of doctor objects.
- Description: Search doctors by name, specialization, or location (OR logic).
- Query:
search(string) - Responses: Array of doctor objects.
- Description: Filter doctors by specialization and/or location (AND logic).
- Query:
specialization(string),location(string) - Responses: Array of doctor objects.
- Description: Filter doctors by both specialization and location (both required).
- Query:
specialization(string),location(string) - Responses: Array of doctor objects.
- Description: Register a new doctor (alternative to
/auth/signup). - Body: Doctor object
- Responses:
201 Created: Doctor object500 Internal Server Error:{ error }
- Description: Update a doctor's profile.
- Body: Fields to update
- Responses: Updated doctor object
- Description: Delete a doctor account.
- Responses:
{ message }
- Description: Get a doctor by ID.
- Responses: Doctor object
- Description: Get all unique cities from doctor profiles.
- Responses: Array of city names
- Description: Get all doctors (admin use).
- Responses: Array of doctor objects
- Description: Verify/unverify a doctor.
- Body:
{ verified: true|false } - Responses: Updated doctor object
- Description: Book a new appointment.
- Body:
{ patient, doctor, appointmentDate, timeSlot, reason } - Responses:
201 Created:{ message, appointment }400/404/500:{ message, error }
- Description: Get all appointments (admin/debug).
- Responses: Array of appointment objects
- Description: Get appointments for a specific patient.
- Responses: Array of appointment objects
- Description: Get appointments for a specific doctor.
- Responses: Array of appointment objects
- Description: Update appointment status (confirmed, cancelled, completed).
- Body:
{ status } - Responses:
{ message, appointment }
- Description: Delete an appointment.
- Responses:
{ message }
- Description: Create a new prescription.
- Body: Prescription object
- Responses:
{ message, prescription, prescriptionNumber }
- Description: Get prescriptions for a doctor (with pagination and search).
- Query:
page,limit,search - Responses:
{ prescriptions, totalPages, currentPage, total }
- Description: Get a single prescription by ID.
- Responses: Prescription object
- Description: Get a patient's prescription history by phone or name.
- Responses:
{ prescriptions, count }
- Description: Update a prescription.
- Body: Fields to update
- Responses:
{ message, prescription }
- Description: Delete a prescription.
- Responses:
{ message }
- Description: Create a new surgery request.
- Body: Surgery object
- Responses: Surgery object
- Description: Get all surgery requests.
- Responses: Array of surgery objects
- Description: Get a single surgery request by ID.
- Responses: Surgery object
- Description: Update a surgery request (assign doctor, change status, etc).
- Body: Fields to update
- Responses: Updated surgery object
- Description: Get all laboratories with their tests.
- Responses: Array of laboratory objects
- Description: Add a new laboratory.
- Body:
{ labId, labName, tests } - Responses: Laboratory object
- Description: Search for medicines by brand name using the openFDA public API. Used in the app for medicine lookup and details.
- Parameters:
search(string, required): e.g.openfda.brand_name:Panadol*limit(integer, optional): Number of results to return (default varies)
- Example:
https://api.fda.gov/drug/label.json?search=openfda.brand_name:Panadol*&limit=10
- Response:
- Array of drug label objects (see openFDA documentation for full schema)
- Note:
- This is a public API provided by the US FDA, not by Healr. Data is for informational purposes only.
- All endpoints return errors in the form
{ error: string }or{ message: string }with appropriate HTTP status codes.
- All endpoints accept and return JSON.
- Some endpoints require specific fields or object structures; see the respective model for details.