Skip to main content
GET
/
users
List Users
curl --request GET \
  --url https://api.example.com/users
{
  "200": {},
  "_embedded.users": [
    {
      "id": 123,
      "name": "<string>",
      "email": "<string>",
      "role": {},
      "createdAt": {},
      "_links": {
        "self": {
          "href": "<string>"
        }
      }
    }
  ],
  "_links": {
    "self": {
      "href": "<string>"
    }
  }
}

Description

Retrieve a paginated list of all users in the system. Returns a collection of user objects with HATEOAS links for navigation.
The password field is never included in response objects for security purposes.

Request

This endpoint does not require any parameters.

Response

Returns a CollectionModel containing an array of user objects wrapped in EntityModel with HATEOAS links.
_embedded.users
array
Array of user objects
id
Long
required
Unique identifier for the user
name
string
required
Full name of the user
email
string
required
Email address of the user
role
enum
required
User role in the system. Possible values: CUSTOMER, ADMIN
createdAt
LocalDateTime
required
Timestamp when the user was created (ISO 8601 format)
HATEOAS links for the user resource
self
object
Link to this specific user
href
string
URL to the user resource
HATEOAS links for the collection
self
object
Link to this collection
href
string
URL to the users collection

Status Codes

200
OK
Successfully retrieved the list of users

Security

Password fields are encrypted using PasswordEncoder and are never returned in API responses.

Example Request

cURL
curl -X GET http://localhost:8080/users \
  -H "Content-Type: application/json"

Example Response

{
  "_embedded": {
    "users": [
      {
        "id": 1,
        "name": "John Doe",
        "email": "[email protected]",
        "role": "CUSTOMER",
        "createdAt": "2026-03-01T10:30:00",
        "_links": {
          "self": {
            "href": "http://localhost:8080/users/1"
          }
        }
      },
      {
        "id": 2,
        "name": "Jane Smith",
        "email": "[email protected]",
        "role": "ADMIN",
        "createdAt": "2026-03-02T14:15:00",
        "_links": {
          "self": {
            "href": "http://localhost:8080/users/2"
          }
        }
      }
    ]
  },
  "_links": {
    "self": {
      "href": "http://localhost:8080/users"
    }
  }
}

Build docs developers (and LLMs) love