Tokens expire after 24 hours and must be refreshed by logging in again.
| Method |
Endpoint |
Description |
Auth Required |
| POST |
/auth/register |
Register a new user account |
❌ |
| POST |
/auth/login |
Login and receive JWT token |
❌ |
| Method |
Endpoint |
Description |
Auth Required |
| GET |
/departments |
Retrieve all departments |
✅ |
| GET |
/departments/{id} |
Retrieve department by ID |
✅ |
| POST |
/departments |
Create a new department |
🔒 Admin |
| PUT |
/departments/{id} |
Update a department |
🔒 Admin |
| DELETE |
/departments/{id} |
Delete a department |
🔒 Admin |
| Method |
Endpoint |
Description |
Auth Required |
| GET |
/doctors |
Retrieve all doctors |
✅ |
| GET |
/doctors/{id} |
Retrieve doctor by ID |
✅ |
| POST |
/doctors |
Add a new doctor |
🔒 Admin |
| PUT |
/doctors/{id} |
Update a doctor profile |
🔒 Admin |
| DELETE |
/doctors/{id} |
Remove a doctor |
🔒 Admin |
| Method |
Endpoint |
Description |
Auth Required |
| GET |
/patients |
Retrieve all patients |
✅ |
| GET |
/patients/{id} |
Retrieve patient by ID |
✅ |
| POST |
/patients |
Register a new patient |
✅ |
| PUT |
/patients/{id} |
Update patient record |
✅ |
| DELETE |
/patients/{id} |
Remove a patient |
🔒 Admin |
| Method |
Endpoint |
Description |
Auth Required |
| GET |
/appointments |
Retrieve all appointments |
✅ |
| GET |
/appointments/{id} |
Retrieve appointment by ID |
✅ |
| POST |
/appointments |
Book a new appointment |
✅ |
| PUT |
/appointments/{id} |
Update an appointment |
✅ |
| DELETE |
/appointments/{id} |
Cancel an appointment |
✅ |
POST https://hospital-production-db4b.up.railway.app/auth/register
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"password": "password123",
"role": "PATIENT"
}
Response:
{
"token": "eyJhbGciOiJIUzM4NCJ9..."
}
POST https://hospital-production-db4b.up.railway.app/appointments
Authorization: Bearer your_token_here
Content-Type: application/json
{
"doctorId": 1,
"patientId": 1,
"appointmentDate": "2026-04-01T10:00:00",
"reason": "General checkup"
}
| HTTP Status |
Meaning |
| 200 OK |
Request successful |
| 201 Created |
Resource created successfully |
| 400 Bad Request |
Invalid input or business rule violation |
| 401 Unauthorized |
Missing or invalid JWT token |
| 403 Forbidden |
Insufficient role permissions |
| 404 Not Found |
Requested resource does not exist |
| 500 Internal Server Error |
Unexpected server error |
Erdenesuren Shirmen
Senior Computer Science Student — Missouri State University (Graduating July 2026)
