Endpoint
Updates an existing user’s information in the Sistema Venta application. All user fields can be modified including name, email, role, and active status.
Request Body
Unique identifier of the user to update
Email address for the user
Role identifier to assign to the user
New password for the user account (only include if changing password)
Active status (1 = active, 0 = inactive)
Response
The endpoint returns a Response<bool> wrapper indicating whether the update was successful.
Indicates if the user was successfully updated
True if the user was updated, false otherwise
Error message if status is false
Example Request
curl -X PUT "https://api.example.com/api/Usuario/Editar" \
-H "Content-Type: application/json" \
-d '{
"idUsuario": 3,
"nombreCompleto": "Carlos Alberto Martínez",
"correo": "[email protected] ",
"idRol": 1,
"esActivo": 1
}'
Example Response
Success
Error - User Not Found
Error - Invalid Email
{
"status" : true ,
"value" : true ,
"msg" : null
}
Implementation Details
Controller : UsuarioController.cs:89
Service Method : IUsuarioService.Editar(UsuarioDTO)
Request Source : [FromBody]
Response Type : Response<bool>
HTTP Status : Always returns 200 OK (check status field for actual result)
Notes
The idUsuario field is required to identify which user to update
Only include the clave field if you want to change the user’s password
Email addresses must remain unique in the system
The rolDescripcion field is ignored in the request; it’s populated based on idRol
If the user doesn’t exist, the value will be false and an error message will be provided