Skip to main content
GET
/
api
/
users
List Users
curl --request GET \
  --url https://api.example.com/api/users
{
  "users": [
    {
      "id": "<string>",
      "email": "<string>",
      "role": "<string>",
      "isActive": true,
      "firstName": "<string>",
      "lastName": "<string>",
      "phone": "<string>",
      "profileImage": "<string>",
      "supervisorId": "<string>",
      "lastLoginAt": "<string>",
      "loginCount": 123,
      "createdAt": "<string>"
    }
  ],
  "pagination": {
    "page": 123,
    "limit": 123,
    "total": 123,
    "totalPages": 123
  }
}
Retrieve a paginated list of all system users with optional filtering.

Authentication

Required. All authenticated users can view the user list.

Query Parameters

page
number
default:"1"
Page number for pagination
limit
number
default:"10"
Number of users per page
role
string
Filter by role (ADMIN, SUPERVISOR, CREDIT_OFFICER)
isActive
boolean
Filter by active status
Search by name or email

Response

users
array
pagination
object

Example Request

cURL
curl -X GET "https://api.millenium-potters.com/api/users?page=1&limit=10&role=CREDIT_OFFICER" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch('/api/users?role=CREDIT_OFFICER', {
  headers: {
    'Authorization': `Bearer ${token}`
  }
});
const data = await response.json();

Example Response

{
  "users": [
    {
      "id": "clx123abc",
      "email": "[email protected]",
      "role": "CREDIT_OFFICER",
      "isActive": true,
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+234-800-0000",
      "profileImage": "/uploads/profiles/profile-123.jpg",
      "supervisorId": "clx456def",
      "lastLoginAt": "2026-03-11T10:30:00Z",
      "loginCount": 45,
      "createdAt": "2026-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 15,
    "totalPages": 2
  }
}

Error Responses

Missing or invalid authentication token.
Invalid query parameters (e.g., invalid role value).

Build docs developers (and LLMs) love