/api/usuario
Creates a new user record. If a Base64-encoded image is provided, it is uploaded to Cloudinary before the record is inserted. The password is hashed with bcrypt (10 salt rounds) before storage.
Request body
Username for the new account.
Profile (role) ID. Must reference an existing record in the
perfil table.Plain-text password. Hashed with bcrypt before being stored — never persisted in plain text.
Email address. Must be unique across all users.
Phone number. Optional — stored as
null if omitted.Active status of the account.
true = active, false = inactive.Base64-encoded image string (must start with
data:image). When provided, the image is uploaded to the usuarios_corp Cloudinary folder (resized to a maximum width of 1000 px, quality auto-optimized) and the resulting secure URL is stored as imagenUrl. Omit this field if no image is needed.Response
true when the user is created successfully.The newly created user record as returned by the database.
Error responses
| Status | Cause |
|---|---|
500 | Cloudinary upload failed, the image payload is too large, or a database constraint was violated (e.g., duplicate strCorreo). |
Examples
Success response
200