List Users
Authentication
Required: JWT token via cookieRole: Administrador
Request Parameters
No parameters required.Response
Success indicator
HTTP status code (200)
Empty string
Array of user objects
Example Request
Example Response
Error Responses
401 Unauthorized
Missing or invalid authentication token
403 Forbidden
User does not have Administrator role
500 Internal Server Error
Server error
Create User
Authentication
Required: JWT token via cookieRole: Administrador
Request Body
Username (must be unique)
User password (will be hashed with bcrypt)
Email address
User role: “Usuario” or “Administrador”
Response
Success indicator
HTTP status code (201)
“Usuario registrado exitosamente.”
No data returned
Example Request
Example Response
Error Responses
401 Unauthorized
Missing or invalid authentication token
403 Forbidden
User does not have Administrator role
500 Internal Server Error
Server error or duplicate username/email
Get User by ID
Authentication
Required: JWT token via cookieRole: Administrador
Path Parameters
User ID
Response
Success indicator
HTTP status code (200)
Empty string
User object with same structure as list endpoint (password field excluded)
Example Request
Example Response
Error Responses
400 Bad Request
User not found
401 Unauthorized
Missing or invalid authentication token
403 Forbidden
User does not have Administrator role
500 Internal Server Error
Server error
Update User
Authentication
Required: JWT token via cookieRole: Administrador
Path Parameters
User ID
Request Body
Username
User password (will be hashed with bcrypt)
Email address
User role: “Usuario” or “Administrador”
Response
Success indicator
HTTP status code (200)
“Usuario actualizado exitosamente.”
No data returned
Example Request
Example Response
Error Responses
400 Bad Request
User not found
401 Unauthorized
Missing or invalid authentication token
403 Forbidden
User does not have Administrator role
500 Internal Server Error
Server error
Delete User
Authentication
Required: JWT token via cookieRole: Administrador
Path Parameters
User ID
Response
Success indicator
HTTP status code (200)
“Usuario eliminado exitosamente.”
No data returned
Example Request
Example Response
Error Responses
400 Bad Request
User not found
401 Unauthorized
Missing or invalid authentication token
403 Forbidden
User does not have Administrator role
500 Internal Server Error
Server error
Notes
- All user management endpoints require Administrator role
- Passwords are hashed using bcrypt with 10 salt rounds before storage
- Password hashes are never returned in API responses
- All timestamps are automatically managed by the database
- The
creadofield is set toCURRENT_TIMESTAMPon creation - The
actualizadofield is updated toCURRENT_TIMESTAMPon every update - User data is retrieved from the
UsuariosViewdatabase view - Users are returned ordered by name alphabetically
- Username and email must be unique in the system
