Members
Manage team members, roles, and HR operations.
Get All Users
GET
/api/usersGet all users in the company.
| Query Param | Type | Required | Description |
|---|---|---|---|
role | string | Optional | Filter by role |
{
"users": [
{
"id": "...",
"name": "John Doe",
"email": "john@example.com",
"role": "employee",
"avatarUrl": "...",
"company": "companyId",
"team": "teamId",
"customRole": "Software Engineer"
}
]
}
Change Member Role
PATCH
/api/hr/member-roleChange a member's role (HR/Admin only).
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Required | User ID |
newRole | string | Required | New role (admin, human-resource, project-manager, etc.) |
{
"user": { ... updated user }
}
Update Member Region
PATCH
/api/hr/member-regionUpdate a member's region/office location.
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Required | User ID |
regionLabel | string | Required | Region label |
{
"user": { ... updated user }
}
Set Member Salary
POST
/api/hr/member-salary/[id]Set or update a member's salary (HR only).
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Required | User ID (path param) |
salary | number | Required | Annual salary amount |
currency | string | Optional | Currency code (default: INR) |
{
"user": { ... updated user with salary }
}
Update PF/ESIC
PATCH
/api/hr/member-pf-esic/[id]Update PF and ESIC details for a member.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Required | User ID (path param) |
pfNumber | string | Optional | PF account number |
pfDeductionAmount | number | Optional | PF deduction amount |
esicNumber | string | Optional | ESIC number |
esicDeductionAmount | number | Optional | ESIC deduction amount |
{
"user": { ... updated user }
}
Get Member Documents
GET
/api/hr/member-documents/[id]Get documents of a specific member (HR only).
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Required | User ID (path param) |
{
"documents": [...]
}
Fire Member
POST
/api/hr/fireTerminate a member (HR/Admin only).
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Required | User ID to terminate |
reason | string | Optional | Termination reason |
{
"success": true
}
Revoke ID Card
POST
/api/hr/revoke-id-cardRevoke a member's ID card.
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Required | User ID |
{
"success": true
}
Update Company Policy
PATCH
/api/hr/policyUpdate company HR policies (HR only).
| Field | Type | Required | Description |
|---|---|---|---|
noticePeriodDays | number | Optional | Notice period in days |
paidLeaveDays | number | Optional | Paid leave days per period |
paidLeavePeriod | string | Optional | Leave period (monthly/yearly) |
minWorkHours | number | Optional | Minimum work hours per day |
{
"company": { ... updated company }
}