GET /admin/users

Retrieves a list of all users. Admin access required.

Query parameters

  • page integer

    Page number for pagination

    Minimum value is 1. Default value is 1.

  • pageSize integer

    Number of users per page (1-100)

    Minimum value is 1, maximum value is 100. Default value is 10.

Responses

  • 200 application/json

    Successful retrieval of user list

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data array[object]
      Hide data attributes Show data attributes object
      • id string

        Unique identifier for the user

      • email string(email)

        User's email address

      • firstName string

        User's first name

      • lastName string

        User's last name

      • dateOfBirth string(date)

        User's date of birth

      • avatarUrl string | null

        URL of the user's profile avatar

      • createdAt string(date-time)

        Timestamp when the user profile was created

      • updatedAt string(date-time)

        Timestamp when the user profile was last updated

      • phoneNumber string | null

        User's phone number (optional)

    • pagination object
      Hide pagination attributes Show pagination attributes object
      • currentPage

        The current page number (1-based indexing)

      • pageSize

        Number of items per page

      • totalItems

        Total number of items across all pages

      • totalPages

        Total number of available pages

  • 401 application/json

    Unauthorized - Invalid or missing token

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 403 application/json

    Forbidden - Admin access required

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
GET /admin/users
curl \
 --request GET 'http://localhost:8080/api/admin/users' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": [
    {
      "id": "user_12345",
      "email": "user@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "dateOfBirth": "1990-01-01",
      "avatarUrl": "https://cdn.example.com/avatars/user_12345.jpg",
      "createdAt": "2025-08-30T10:30:00Z",
      "updatedAt": "2025-08-30T15:45:00Z",
      "phoneNumber": "+1234567890"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "pageSize": 10,
    "totalItems": 100,
    "totalPages": 10
  }
}
Response examples (401)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}
Response examples (403)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}