GET /api/users/
Retrieves a single user by their unique identifier. This endpoint requires read privileges or admin role.
Authentication
This endpoint requires JWT authentication with one of the following:
READ_PRIVILEGES authority
ADMIN role
Path Parameters
The unique identifier of the user to retrieve
Response
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 - User found and returned successfully
401 - Unauthorized: Missing or invalid JWT token
403 - Forbidden: Insufficient permissions
404 - Not Found: User does not exist
Example Request
curl -X GET https://api.example.com/api/users/550e8400-e29b-41d4-a716-446655440000 \
-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": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"name": "READ_PRIVILEGES",
"description": "Can read resources"
}
],
"status": "ACTIVO"
}
],
"status": "ACTIVO"
}
Example Error Response
{
"timestamp": "2026-03-04T10:30:00Z",
"requestId": "abc123-def456",
"message": "User not found",
"detail": "Usuario con id 550e8400-e29b-41d4-a716-446655440000 no encontrado"
}