Skip to main content

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)

ParameterTypeRequiredDescription
companyIdString (UUID)NoFilter by company ID
departmentIdString (UUID)NoFilter by department ID
bandIdString (UUID)NoFilter by employee band ID
searchStringNoSearch by name, email, or phone
pageNumberNoPage number (Default: 1)
limitNumberNoItems 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: SELECT with findMany and count.