API Reference
Complete API documentation for PeopleHub services.
Interactive API Documentation
Each backend service has interactive API documentation at the /docs endpoint:
- Main API:
https://api.peoplehub.dev.wysbryxapp.com/docs - Candidate API:
https://candidate-api.peoplehub.dev.wysbryxapp.com/docs - Integration API:
https://integration-api.peoplehub.dev.wysbryxapp.com/docs - Notifications API:
https://notifications-api.peoplehub.dev.wysbryxapp.com/docs
Format: OpenAPI/Swagger via Scalar UI Features: Interactive testing, request/response examples, schema validation
API Base URLs
Development:
- Main API:
https://api.peoplehub.dev.wysbryxapp.com - Candidate API:
https://candidate-api.peoplehub.dev.wysbryxapp.com
Staging:
- Main API:
https://api.peoplehub.staging.wysbryxapp.com - Candidate API:
https://candidate-api.peoplehub.staging.wysbryxapp.com
Production: Client-specific domains
Authentication
Method: JWT Bearer token in HTTP-only cookie
Endpoints:
- Login:
POST /api/auth/login - Refresh:
POST /api/auth/refresh - Logout:
POST /api/auth/logout
All protected endpoints require valid JWT token.
Common Endpoints (Main API)
Employees
GET /api/employees- List employeesGET /api/employees/:id- Get employee detailsPOST /api/employees- Create employeePUT /api/employees/:id- Update employeeDELETE /api/employees/:id- Delete employee
Leave
GET /api/leave- List leave applicationsPOST /api/leave- Apply for leavePUT /api/leave/:id/approve- Approve leavePUT /api/leave/:id/reject- Reject leave
Performance
GET /api/performance/cycles- List performance cyclesGET /api/okr- List OKRsPOST /api/okr- Create OKRPUT /api/okr/:id- Update OKR
Separation
POST /api/separation- Initiate separationPUT /api/separation/:id/approve- Approve separationGET /api/separation/:id/clearance- Get clearance status
Full documentation: Visit /docs endpoint on each API
Response Format
Success (200, 201):
json
{
"data": { /* response data */ },
"message": "Success"
}Error (400, 401, 404, 500):
json
{
"statusCode": 400,
"error": "Bad Request",
"message": "Detailed error message"
}HTTP Status Codes
- 200 OK: Successful GET request
- 201 Created: Successful POST request
- 400 Bad Request: Invalid input
- 401 Unauthorized: Missing/invalid token
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource not found
- 500 Internal Server Error: Server error
Pagination
List endpoints support pagination:
Query Parameters:
page: Page number (default: 1)limit: Items per page (default: 20, max: 100)
Response:
json
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
}Filtering & Sorting
Filtering: ?status=active&department=engineeringSorting: ?sortBy=createdAt&order=desc
Supported on most list endpoints.
Rate Limiting
Current: No explicit rate limits Planned: 1000 requests per minute per user (production)
API Versioning
Current: v1 (implicit, no version prefix) Future: /v2/ prefix for breaking changes
Data Model
Database Overview
Engine: PostgreSQL 17.5 Tables: 140+ tables Deployment: AWS RDS Multi-AZ ORM: Drizzle ORM (type-safe queries)
Core Entities
Users & Authentication:
user_master: User accounts and login credentialsrole,permission,role_permission: RBAC system
Company & Organization:
company_master,customer_master,agency_masterdata_group,master_data: Configuration data
Employees:
user_employment_details: Employment informationuser_onboarding: Onboarding progressproject_allocation: Project assignments
Recruitment & Onboarding:
demand_master,demand_skill,employee_demand_status- Onboarding tables: Personal info, documents, BGV
Leave & Attendance:
- Leave applications, balances, policies
- Attendance logs, regularization requests
Performance:
performance_cycle,okr,okr_goal,sub_goalokr_review,rating_scale
Separation:
separation_request,separation_approvalexit_survey_*, NOC tables
Skills & Certifications:
skill,skill_group,skill_clustercertifications,certification_providers
Workflows:
request,request_approval,request_escalation_map
Notifications:
notification_definition,notification_templatenotification_schedule
Support:
support_ticket,support_ticket_commentsupport_ticket_attachment
Key Relationships
- User → Employee: One-to-one
- Employee → Manager: Self-referencing (reporting hierarchy)
- Company → Departments: One-to-many
- Employee → Projects: Many-to-many
- Performance Cycle → OKRs → Goals: Hierarchical