Skip to main content
GET
/
api
/
users
List Users
curl --request GET \
  --url https://api.example.com/api/users
{
  "users": [
    {
      "id": 123,
      "username": "<string>",
      "email": "<string>",
      "password_hash": "<string>",
      "firstname": "<string>",
      "lastname": "<string>",
      "phone_number": "<string>",
      "role": "<string>",
      "is_active": true,
      "profileImage": "<string>",
      "created_at": {},
      "updated_at": {}
    }
  ]
}

Overview

This endpoint returns all users registered in the DriveX system. The response includes complete user profiles with all associated information.

Request

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

Response

users
array
Array of user objects
id
long
Unique identifier for the user
username
string
User’s username
email
string
User’s email address
password_hash
string
Encrypted password hash
firstname
string
User’s first name
lastname
string
User’s last name
phone_number
string
User’s phone number
role
string
User’s role in the system (e.g., ADMIN, USER, DRIVER)
is_active
boolean
Whether the user account is active
profileImage
string
URL or path to the user’s profile image
created_at
timestamp
Timestamp when the user was created
updated_at
timestamp
Timestamp when the user was last updated

Example Response

[
  {
    "id": 1,
    "username": "johndoe",
    "email": "[email protected]",
    "password_hash": "$2a$10$...",
    "firstname": "John",
    "lastname": "Doe",
    "phone_number": "+1234567890",
    "role": "USER",
    "is_active": true,
    "profileImage": "/images/profiles/johndoe.jpg",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-20T14:45:00Z"
  },
  {
    "id": 2,
    "username": "janesmith",
    "email": "[email protected]",
    "password_hash": "$2a$10$...",
    "firstname": "Jane",
    "lastname": "Smith",
    "phone_number": "+1234567891",
    "role": "DRIVER",
    "is_active": true,
    "profileImage": "/images/profiles/janesmith.jpg",
    "created_at": "2024-01-16T09:20:00Z",
    "updated_at": "2024-01-22T11:30:00Z"
  }
]

Build docs developers (and LLMs) love