List Users API
Overview
Retrieves a paginated list of users filtered by company, department, or band.
- Endpoint:
/api/users/list - Method:
GET - Access: Corporate Admin / Manager
Query Parameters (req.query)
| Parameter | Type | Required | Description |
|---|---|---|---|
companyId | String (UUID) | No | Filter by company ID |
departmentId | String (UUID) | No | Filter by department ID |
bandId | String (UUID) | No | Filter by employee band ID |
search | String | No | Search by name, email, or phone |
page | Number | No | Page number (Default: 1) |
limit | Number | No | Items per page (Default: 10, Max: 100) |
Query Example
GET /api/users/list?companyId=c478a846-993d-4c8d-bf8d-d77cb3370e01&search=Vikram&page=1&limit=10
Success Response (200 OK)
{
"success": true,
"message": "Users retrieved successfully",
"data": [
{
"id": "u9876543-21ba-fedc-3210-9876543210fe",
"email": "vikram.singh@abbott.com",
"firstName": "Vikram",
"lastName": "Singh",
"employeeBand": "Band 1",
"band": {
"id": "b1234567-89ab-cdef-0123-456789abcdef",
"name": "Band 1",
"autoApprovalLimit": "7000.00"
}
}
],
"pagination": {
"totalItems": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 10,
"hasNextPage": false,
"hasPreviousPage": false
}
}
Database Impact
- Table:
users - Operations:
SELECTwithfindManyandcount.