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.

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

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

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

Error responses

StatusCause
500Cloudinary upload failed, the image payload is too large, or a database constraint was violated (e.g., duplicate strCorreo).
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

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

Success response

200
{
  "success": true,
  "data": {
    "id": 12,
    "strNombreUsuario": "jdoe",
    "idPerfil": 2,
    "strPwd": "$2b$10$...",
    "strCorreo": "jdoe@example.com",
    "strNumeroCelular": "555-9876",
    "idEstadoUsuario": true,
    "imagenUrl": null
  }
}