GET /api/users
Retrieves a list of all users in the system. This endpoint requires read privileges or admin role.
Authentication
This endpoint requires JWT authentication with one of the following:
READ_PRIVILEGES authority
ADMIN role
Response
Returns an array of user objects.
Unique identifier for the user
Whether the user account is enabled
Whether the user account has not expired
Whether the user account is not locked
Whether the user’s credentials have not expired
List of roles assigned to the user
User status (ACTIVO or INACTIVO)
Error Codes
200 - Users retrieved successfully
401 - Unauthorized: Missing or invalid JWT token
403 - Forbidden: Insufficient permissions
Example Request
curl -X GET https://api.example.com/api/users \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Example Response
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"names": "John Michael Doe",
"email": "john.doe@example.com",
"isEnabled": true,
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"roles": [
{
"id": "660e8400-e29b-41d4-a716-446655440000",
"name": "USER",
"description": "Standard user role",
"permissions": [],
"status": "ACTIVO"
}
],
"status": "ACTIVO"
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"names": "Jane Smith",
"email": "jane.smith@example.com",
"isEnabled": true,
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"roles": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"name": "ADMIN",
"description": "Administrator role",
"permissions": [],
"status": "ACTIVO"
}
],
"status": "ACTIVO"
}
]