API Reference
Complete REST API documentation — all endpoints, request formats, and response schemas.
Updated June 2026 12 min read
This page documents all available REST API endpoints in The Care Nexus. The base URL for all endpoints in development is http://localhost:5000/api. In production, replace with your deployed backend URL.
All protected endpoints require a valid JWT token in Authorization: Bearer <token>.
Authentication
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /auth/register | None | Create account |
| POST | /auth/login | None | Login user |
| POST | /auth/logout | Bearer | Invalidate session |
| POST | /auth/refresh | None | Refresh token |
| POST | /auth/forgot-password | None | Send reset email |
| POST | /auth/reset-password/:token | None | Reset password |
| GET | /auth/verify/:token | None | Verify email |
Patient Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /patient/dashboard | Dashboard stats |
| GET | /patient/profile | Get profile |
| PUT | /patient/profile | Update profile |
| GET | /patient/appointments | List appointments |
| POST | /patient/appointments | Book appointment |
| PUT | /patient/appointments/:id/cancel | Cancel appointment |
| GET | /patient/records | Medical records |
| GET | /patient/records/:id | Record detail |
| GET | /patient/family | Family members |
| POST | /patient/family | Add family member |
| PUT | /patient/family/:memberId | Update family member |
| DELETE | /patient/family/:memberId | Delete family member |
| GET | /patient/family/:memberId/records | Family records |
Doctor Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /doctor/patients | Patient list |
| POST | /doctor/patients | Add patient |
| GET | /doctor/patients/:id | Patient detail |
| DELETE | /doctor/patients/:id | Remove patient |
| GET | /doctor/appointments | Appointments queue |
| PUT | /doctor/appointments/:id | Update status |
| GET | /doctor/prescriptions | Prescription history |
| POST | /doctor/prescriptions | Create prescription |
| PUT | /doctor/prescriptions/:id | Edit prescription |
| DELETE | /doctor/prescriptions/:id | Delete prescription |
| GET | /doctor/schedule | Get schedule |
| PUT | /doctor/schedule | Update schedule |
| GET | /doctor/revenue | Revenue data |
Clinic Admin Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /clinic/analytics/overview | KPIs |
| GET | /clinic/analytics/patient-flow | Patient flow |
| GET | /clinic/analytics/revenue | Revenue analytics |
| GET | /clinic/doctors | Doctors list |
| POST | /clinic/doctors | Invite doctor |
| DELETE | /clinic/doctors/:id | Remove doctor |
| GET | /clinic/doctors/:id/stats | Doctor stats |
| GET | /clinic/appointments | All appointments |
| GET | /clinic/settings | Clinic settings |
| PUT | /clinic/settings | Update settings |
| GET | /clinic/staff | Staff list |
| POST | /clinic/staff | Create staff |
| PUT | /clinic/staff/:id | Update staff |
| DELETE | /clinic/staff/:id | Delete staff |
AI Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /ai/gemini/chat | AI chat |
| POST | /ai/chat/transcribe | Voice transcription |
| POST | /ai/gemini/parse-prescription | Parse prescription |
Response envelope
All responses follow: { success, message, data, statusCode }