http://localhost:5000/api
curl http://localhost:5000/api/healthGET http://localhost:5000/api/departmentsGET http://localhost:5000/api/departments/{id}POST http://localhost:5000/api/departments
Content-Type: application/json
{
"name": "Human Resources",
"description": "Manages employee relations, recruitment, and benefits"
}PUT http://localhost:5000/api/departments/{id}
Content-Type: application/json
{
"name": "Human Resources Updated",
"description": "Updated description",
"isActive": true
}DELETE http://localhost:5000/api/departments/{id}GET http://localhost:5000/api/departments/statsGET http://localhost:5000/api/employees?page=1&limit=10GET http://localhost:5000/api/employees?search=johnGET http://localhost:5000/api/employees?department={departmentId}GET http://localhost:5000/api/employees?jobTitle=engineerGET http://localhost:5000/api/employees?search=john&department={departmentId}&page=1&limit=10GET http://localhost:5000/api/employees/{id}POST http://localhost:5000/api/employees
Content-Type: application/json
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@company.com",
"phone": "123-456-7890",
"jobTitle": "Software Engineer",
"department": "{departmentId}",
"supervisor": "{supervisorId}",
"country": "United States",
"state": "California",
"city": "San Francisco",
"address": "123 Tech Street",
"zipCode": "94102",
"salary": 75000,
"gender": "Male"
}PUT http://localhost:5000/api/employees/{id}
Content-Type: application/json
{
"jobTitle": "Senior Software Engineer",
"salary": 85000
}DELETE http://localhost:5000/api/employees/{id}GET http://localhost:5000/api/employees/supervisors/list?employeeId={id}GET http://localhost:5000/api/employees/statsGET http://localhost:5000/api/locations/countriesGET http://localhost:5000/api/locations/countries?search=unitedGET http://localhost:5000/api/locations/states/United%20StatesGET http://localhost:5000/api/locations/cities/United%20States/CaliforniaGET http://localhost:5000/api/locations/country-details/United%20StatesPOST /api/departments
{
"name": "Engineering",
"description": "Software Development Team"
}Save the _id from response
POST /api/employees
{
"firstName": "Jane",
"lastName": "Smith",
"email": "jane.smith@company.com",
"phone": "555-123-4567",
"jobTitle": "Engineering Manager",
"department": "{departmentId from step 1}",
"country": "United States",
"state": "California",
"city": "San Francisco",
"salary": 95000
}Save the _id from response
POST /api/employees
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@company.com",
"phone": "555-987-6543",
"jobTitle": "Software Engineer",
"department": "{departmentId from step 1}",
"supervisor": "{supervisorId from step 2}",
"country": "United States",
"state": "California",
"city": "San Francisco",
"salary": 75000
}GET /api/employees?search=johnGET /api/employees?department={departmentId}GET /api/departments/stats
GET /api/employees/stats{
"success": true,
"count": 10,
"data": [...],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalRecords": 50,
"recordsPerPage": 10,
"hasNextPage": true,
"hasPrevPage": false
}
}{
"success": false,
"message": "Error message here",
"error": "Detailed error"
}page- Page number (default: 1)limit- Records per page (default: 10)
sort- Sort by field (e.g.,sort=firstNameorsort=-createdAt)- Use
-prefix for descending order
search- Search termdepartment- Filter by department IDjobTitle- Filter by job titleisActive- Filter by status (true/false)country,state,city- Location filters
- Health check endpoint
- Create department
- Get all departments
- Get department by ID
- Update department
- Delete department
- Create employee
- Get all employees
- Search employees
- Filter employees by department
- Filter employees by job title
- Get employee by ID
- Update employee
- Delete employee
- Get potential supervisors
- Get countries
- Get states
- Get cities
- Pagination working
- Statistics endpoints
All endpoints are now ready for testing! 🚀