Skip to main content
PUT
/
api
/
Usuario
/
{id}
curl --request PUT \
  --url https://your-api-host/api/Usuario/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "IdPerfil": 3,
    "Activo": true
  }'
"Usuario actualizado correctamente"
Updates the profile assignment, active status, and optionally the profile image for an existing user. The caller must hold the usuario.editar permission.

Authentication

Requires a valid Bearer token with the usuario.editar permission.
Authorization: Bearer <token>
A 403 Forbidden response means the token is valid but the caller’s profile does not include the usuario.editar permission. Contact an administrator to update the profile’s permissions.

Path parameters

id
string
required
The GUID of the user to update.

Request body

IdPerfil
integer
required
ID of the profile to assign to the user. The profile controls which permissions the user inherits.
Activo
boolean
required
Active status for the account. Set to false to disable login for this user.
Imagen
string
Optional Base64-encoded profile image in the format data:image/...;base64,.... The decoded image must not exceed 2 MB. If provided, the image is uploaded to Cloudinary and the resulting URL replaces the current value. If omitted, the existing image is left unchanged.Supported MIME types: image/png, image/jpeg, image/gif, image/webp.
To remove a user’s image, pass an empty string or handle image removal through a dedicated endpoint if available. Omitting Imagen entirely preserves the current image.

Responses

StatusDescription
200 OKUser updated successfully. Returns the plain string "Usuario actualizado correctamente".
400 Bad RequestImage validation failed or ASP.NET Identity returned errors.
403 ForbiddenThe caller’s token lacks the usuario.editar permission.
404 Not FoundNo user exists with the given id.

Examples

curl --request PUT \
  --url https://your-api-host/api/Usuario/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "IdPerfil": 3,
    "Activo": true
  }'
"Usuario actualizado correctamente"

Image validation errors

If Imagen is provided but fails validation, the response is 400 Bad Request with a plain string body:
MessageCause
Formato de imagen inválidoThe data: URI prefix or MIME type is not recognised.
Imagen demasiado grandeThe full Base64 string exceeds the size limit before decoding.
Imagen inválidaThe Base64 payload cannot be parsed.
Error al decodificar imagenAn unexpected error occurred while decoding the Base64 data.
La imagen no debe superar 2MBThe decoded image exceeds 2 MB.

Build docs developers (and LLMs) love