Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt

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

Persists a new Usuario to the MySQL database. Before saving, the plaintext password is encoded using BCrypt — the raw value is never stored. The email field must be unique across all users; submitting a duplicate email returns a 400 Bad Request with a descriptive message. A valid OAuth2 Bearer token with the write scope is required. Base URL: http://localhost:8001
Gateway URL: http://localhost:8090/api/usuarios

Endpoint

POST http://localhost:8001/

Request

Headers

HeaderValue
AuthorizationBearer <access_token>
Content-Typeapplication/json

Body Parameters

nombre
string
required
The user’s display name.
email
string
required
A valid, unique email address. If a user with this email already exists the request is rejected with 400.
password
string
required
The user’s plaintext password. It will be BCrypt-encoded before being written to the database. The BCrypt hash is returned in the response body.

Response

201 Created

Returns the newly created Usuario object, including the BCrypt-encoded password hash.
id
number
The auto-generated primary key assigned to the new user.
nombre
string
The user’s display name as provided.
email
string
The user’s unique email address as provided.
password
string
The BCrypt-encoded password hash (e.g. $2a$10$...). The original plaintext password is never stored or echoed.

400 Bad Request — Duplicate Email

Returned when the submitted email is already registered to an existing user.
{
  "mensaje": "ya existe un usuario con este correo!"
}

Example

Request

curl -X POST http://localhost:8001/ \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ana García",
    "email": "ana.garcia@example.com",
    "password": "s3cr3tP@ss"
  }'
Via the API Gateway:
curl -X POST http://localhost:8090/api/usuarios/ \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ana García",
    "email": "ana.garcia@example.com",
    "password": "s3cr3tP@ss"
  }'

Request Body

{
  "nombre": "Ana García",
  "email": "ana.garcia@example.com",
  "password": "s3cr3tP@ss"
}

201 Response

{
  "id": 3,
  "nombre": "Ana García",
  "email": "ana.garcia@example.com",
  "password": "$2a$10$Xv3k8qW2mN5pL9oJ1rT6uO7yZ4hB0cD3eF5gH8iJ2kM4nP6qR8sU"
}

400 Response — Duplicate Email

{
  "mensaje": "ya existe un usuario con este correo!"
}

Build docs developers (and LLMs) love