POST /usuario/crear
Creates a new user with complete profile information and assigns a role.Request
User’s first name(s)
User’s paternal last name
User’s maternal last name
User’s national identification number (DNI)
User’s physical address
User’s phone number
User’s active status (true = active, false = inactive)
Username for authentication
User’s password (will be encrypted)
ID of the role to assign to this user
Request Example
Response
Unique identifier for the created user
User’s first name(s)
User’s paternal last name
User’s maternal last name
User’s DNI
User’s address
User’s phone number
User’s active status
Response Example
Status Codes
200 OK- User created successfully400 Bad Request- Username already exists or validation failed
POST /usuario/asignar-rol
Assigns a role to an existing user.Request
ID of the user to assign the role to
ID of the role to assign
Request Example
Response
Status Codes
200 OK- Role assigned successfully
PUT /usuario/
Updates an existing user’s information.Path Parameters
ID of the user to update
Request Body
User’s first name(s)
User’s paternal last name
User’s maternal last name
User’s DNI
User’s address
User’s phone number
User’s active status
Username
New password (optional, only if changing password)
Role ID to assign
Request Example
Response
Returns the updated user object (same structure as create response).Status Codes
200 OK- User updated successfully404 Not Found- User not found
PUT /usuario//estado
Changes a user’s active/inactive status.Path Parameters
ID of the user
Query Parameters
New status (true = active, false = inactive)
Request Example
Response
Empty response body on success.Status Codes
200 OK- Status updated successfully404 Not Found- User not found
GET /usuario/estado
Lists all users filtered by their active status, including their assigned role.Query Parameters
Filter by status (true = active users, false = inactive users)
Request Example
Response
Returns an array of users with their role information.List of users matching the status filter
User ID
User’s first name(s)
Paternal last name
Maternal last name
DNI
Address
Phone number
Active status
Username
Role name (e.g., “ADMIN”, “USER”, “ALMACENERO”)
Response Example
Status Codes
200 OK- Users retrieved successfully