Skip to main content
GET
/
api
/
v1
/
users
/
findAll
List All Users
curl --request GET \
  --url https://api.example.com/api/v1/users/findAll
{
  "page": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "userName": "jsmith",
      "name": "John Smith",
      "birthDate": "1990-05-15",
      "bookIds": [
        "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "9f3e4a56-2c1d-4b8e-8f6d-5a3c2b1d4e5f"
      ]
    },
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "userName": "mdoe",
      "name": "Mary Doe",
      "birthDate": "1985-08-22",
      "bookIds": [
        "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p"
      ]
    }
  ],
  "count": 2,
  "limit": 10,
  "offset": 0,
  "total_pages": 5,
  "total_count": 47,
  "previous_page": null,
  "current_page": 1,
  "next_page": 2
}
This endpoint returns a paginated collection of users with customizable page size and sorting by user ID in ascending order.

Authentication

This endpoint requires JWT authentication. Include a valid JWT token in the Authorization header.
Authorization: Bearer <your_jwt_token>

Query Parameters

page
integer
default:"0"
The page number to retrieve (zero-based index)
size
integer
default:"10"
The number of users per page

Response

page
array
Array of user objects on the current page
id
string
Unique identifier of the user (UUID format)
userName
string
Username for the user’s account
name
string
Full name of the user
birthDate
string
Date of birth in ISO 8601 format (YYYY-MM-DD)
bookIds
array
Array of book UUIDs associated with this user
count
integer
Number of users on the current page
limit
integer
Maximum number of users per page
offset
integer
Starting position of the first user on current page
total_pages
integer
Total number of pages available
total_count
integer
Total number of users across all pages
previous_page
integer
Previous page number, or null if on first page
current_page
integer
Current page number
next_page
integer
Next page number, or null if on last page

Example Request

cURL
curl -X GET "https://api.library.com/api/v1/users/findAll?page=0&size=10" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "page": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "userName": "jsmith",
      "name": "John Smith",
      "birthDate": "1990-05-15",
      "bookIds": [
        "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "9f3e4a56-2c1d-4b8e-8f6d-5a3c2b1d4e5f"
      ]
    },
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "userName": "mdoe",
      "name": "Mary Doe",
      "birthDate": "1985-08-22",
      "bookIds": [
        "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p"
      ]
    }
  ],
  "count": 2,
  "limit": 10,
  "offset": 0,
  "total_pages": 5,
  "total_count": 47,
  "previous_page": null,
  "current_page": 1,
  "next_page": 2
}

Status Codes

CodeDescription
200Successfully retrieved paginated list of users
401Unauthorized - Invalid or missing JWT token
500Internal server error

Build docs developers (and LLMs) love