Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Israel-Perez/Nuxt-Secure/llms.txt

Use this file to discover all available pages before exploring further.

PUT /api/usuario/:id Updates the fields of an existing user. The core text fields (strNombreUsuario, idPerfil, strCorreo, strNumeroCelular, idEstadoUsuario) are always overwritten. imagenUrl is only updated when a new imagenBase64 value is provided — omitting it leaves the existing photo URL unchanged. strPwd is only re-hashed and updated when a non-empty string is provided.

Path parameters

id
number
required
Primary key of the user to update.

Request body

strNombreUsuario
string
required
Updated username.
idPerfil
number
required
Updated profile (role) ID.
strCorreo
string
required
Updated email address.
strNumeroCelular
string
Updated phone number.
idEstadoUsuario
boolean
required
Updated active status. true = active, false = inactive.
strPwd
string
New plain-text password. If this field is present and non-empty, it is hashed with bcrypt (10 rounds) and replaces the stored hash. Omit or send an empty string to leave the password unchanged.
imagenBase64
string
Base64-encoded replacement image (must start with data:image). When provided, a new image is uploaded to the usuarios_corp Cloudinary folder and imagenUrl is updated to the new secure URL. If omitted, the existing imagenUrl is not modified.

Response

success
boolean
required
true when the update completes without error.
data
object
required
The updated user record as returned by the database.

Error responses

StatusMessageCause
500Error al actualizar: la imagen es demasiado grande o el servidor tardó demasiado.Cloudinary upload failed, the image payload is too large, or the request timed out.
The handler does not return a 404 if the id does not match any record — it will return success: true with data set to undefined. Validate the response data field on the client if you need to confirm the record existed.

Examples

curl --request PUT \
  --url https://your-domain.com/api/usuario/12 \
  --header 'Content-Type: application/json' \
  --cookie 'auth_token=<your-jwt>' \
  --data '{
    "strNombreUsuario": "jdoe",
    "idPerfil": 2,
    "strCorreo": "jdoe-updated@example.com",
    "strNumeroCelular": "555-0000",
    "idEstadoUsuario": true
  }'

Success response

200
{
  "success": true,
  "data": {
    "id": 12,
    "strNombreUsuario": "jdoe",
    "idPerfil": 2,
    "strPwd": "$2b$10$...",
    "strCorreo": "jdoe-updated@example.com",
    "strNumeroCelular": "555-0000",
    "idEstadoUsuario": true,
    "imagenUrl": "https://res.cloudinary.com/demo/image/upload/usuarios_corp/sample.jpg"
  }
}