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.

Performs a full replacement of a Usuario’s mutable fields (nombre, email, password). All three fields must be supplied — this is not a partial update. The incoming password is BCrypt-encoded before being written to the database, and the resulting hash is returned in the response. If the new email differs from the stored one and is already owned by another user, the request is rejected. A valid OAuth2 Bearer token with the write scope is required. Base URL: http://localhost:8001
Gateway URL: http://localhost:8090/api/usuarios

Endpoint

PUT http://localhost:8001/{id}

Request

Headers

HeaderValue
AuthorizationBearer <access_token>
Content-Typeapplication/json

Path Parameters

id
Long
required
The numeric primary key of the user to update. Must be a positive integer.

Body Parameters

nombre
string
required
The user’s updated display name.
email
string
required
The user’s updated email address. Must be unique. If the value differs from the currently stored email and is already registered to another user, a 400 is returned.
password
string
required
The user’s new plaintext password. It will be BCrypt-encoded before storage. The BCrypt hash is returned in the response body.

Response

201 Created

Returns the updated Usuario object, including the BCrypt-encoded password hash.
id
number
The primary key of the updated user.
nombre
string
The user’s updated display name.
email
string
The user’s updated email address.
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 new email is already registered to a different user.
{
  "mensaje": "ya existe un usuario con este correo!"
}

404 Not Found

Returned when no user exists for the provided id. The response body is empty.

Example

Request

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

Request Body

{
  "nombre": "Ana García Rodríguez",
  "email": "ana.garcia@example.com",
  "password": "n3wP@ssw0rd"
}

201 Response

{
  "id": 1,
  "nombre": "Ana García Rodríguez",
  "email": "ana.garcia@example.com",
  "password": "$2a$10$Ab1cDe2fGh3iJk4lMn5oPq6rSt7uVw8xYz9aAbBcCdDeEfFgGhHiI"
}

400 Response — Duplicate Email

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

404 Response

HTTP/1.1 404 Not Found
(empty body)

Build docs developers (and LLMs) love