Skip to main content
POST /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

string
required
Username for the new account.
number
required
Profile (role) ID. Must reference an existing record in the perfil table.
string
required
Plain-text password. Hashed with bcrypt before being stored — never persisted in plain text.
string
required
Email address. Must be unique across all users.
string
Phone number. Optional — stored as null if omitted.
boolean
default:"true"
Active status of the account. true = active, false = inactive.
string
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

boolean
required
true when the user is created successfully.
object
required
The newly created user record as returned by the database.

Error responses

strCorreo has a unique constraint in the database. Attempting to create a user with an email that already exists will result in a 500 error from the database driver.

Examples

Success response

200