Skip to main content
PUT
/
api
/
Usuario
/
Editar
Update User
curl --request PUT \
  --url https://api.example.com/api/Usuario/Editar \
  --header 'Content-Type: application/json' \
  --data '
{
  "idUsuario": 123,
  "nombreCompleto": "<string>",
  "correo": "<string>",
  "idRol": 123,
  "clave": "<string>",
  "esActivo": 123
}
'
{
  "status": true,
  "value": true,
  "msg": "<string>"
}

Endpoint

PUT /api/Usuario/Editar
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

idUsuario
integer
required
Unique identifier of the user to update
nombreCompleto
string
Full name of the user
correo
string
Email address for the user
idRol
integer
Role identifier to assign to the user
clave
string
New password for the user account (only include if changing password)
esActivo
integer
Active status (1 = active, 0 = inactive)

Response

The endpoint returns a Response<bool> wrapper indicating whether the update was successful.
status
boolean
required
Indicates if the user was successfully updated
value
boolean
True if the user was updated, false otherwise
msg
string
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

{
  "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

Build docs developers (and LLMs) love