Quick Start
Production API Base URL:
https://hrm.sun-bd.comPublic integration JSON:
GET https://hrm.sun-bd.com/api/v1/public/integrationSwagger:
https://hrm.sun-bd.com/swaggerPublic pages do not require sign-in. HRM business APIs require a centralized member token or an API Key.
Centralized Member API
Member login, logout, refresh, permissions, and JWKS are managed by the centralized member API. HRM does not create members, update member profiles, or issue member tokens locally.
POST https://hrm.sun-bd.com/api/v1/member-auth/login
POST https://hrm.sun-bd.com/api/v1/member-auth/refresh
POST https://hrm.sun-bd.com/api/v1/member-auth/logout
GET https://hrm.sun-bd.com/api/v1/member-auth/me/permissionsThe browser calls the HRM same-origin proxy, and the backend forwards requests to the centralized Login API. Official member API guide:
https://loginapi.sun-bd.com/docs/integration/member-login-logout.htmlAPI Key
Backend-to-backend integrations can call HRM APIs with an API Key.
X-API-Key: whrm_xxxxxxxxxxxxxxxxxxxxx- API Keys are for system integrations.
- Human sign-in remains centralized through the member API.
- Invalid keys return 401; insufficient scope returns 403.
Common Endpoints
| Function | Endpoint | Scope |
|---|---|---|
| Health | GET /api/health | Public |
| Integration JSON | GET /api/v1/public/integration | Public |
| Employees | GET /api/v1/employees | employee.read |
| Attendance | GET /api/v1/attendance | attendance.read |
| Leave | GET /api/v1/leave | leave.read |
| Documents | GET /api/v1/documents | document.read |
Examples
const response = await fetch("https://hrm.sun-bd.com/api/v1/employees?page=1&pageSize=20", {
headers: { "X-API-Key": process.env.WEMS_HRM_API_KEY }
});
if (!response.ok) throw new Error(`HRM API failed: ${response.status}`);
const body = await response.json();Error Handling
| HTTP | Meaning | Action |
|---|---|---|
| 401 | Invalid token or API Key | Sign in again or use a valid key. |
| 403 | Insufficient permission or API Key scope | Check member-center permissions or API Key scopes. |
| 429 | Rate limit exceeded | Retry later. |
| 5xx | Server-side failure | Record time, endpoint, and traceId before reporting. |