Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Gianluca-X/DigitalMoney/llms.txt

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

The User Service exposes two mutation endpoints for modifying an existing user profile. The first, PUT /users/update/{userId}, performs a full profile update — replacing name, contact information, email, and role in a single operation. The second, PATCH /users/update/alias/{id}, is a targeted alias-only update. Both endpoints require a valid JWT and enforce the same owner-or-admin access control as the GET endpoint.

Full Profile Update

PUT /users/update/{userId}
Base URL: http://localhost:8085 Full URL: http://localhost:8085/users/update/{userId}

Authentication

Authorization: Bearer <token>
The token subject must match the userId being updated, or the principal must hold ROLE_ADMIN. Requests without a valid token are rejected with 401 Unauthorized.

Path Parameters

userId
integer
required
The numeric identifier of the user profile to update.

Request Body

All fields in UserEntryDto are accepted. Although the DTO marks them as @NotBlank, the update service layer applies only the non-null fields you supply.
firstName
string
Updated first name for the user.
lastName
string
Updated last name for the user.
phone
string
Updated contact phone number.
email
string
Updated email address. Must remain unique across the platform. When provided, the change is propagated to the Auth Service via a synchronous Feign call before the local record is updated.
dni
string
Updated national identity document number.
password
string
New password. Send in plain text — the Auth Service BCrypt-hashes it before persisting.
authId
integer
The auth-service record ID for this user. Required when the service needs to forward an email or role change to the Auth Service.
role
string
Updated role for the user. Accepted values: USER, ADMIN. When provided, the change is forwarded to the Auth Service.

Response

Returns 200 OK with a plain-text confirmation message.
Usuario actualizado

Example

curl -X PUT "http://localhost:8085/users/update/42" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "María",
    "lastName": "González",
    "phone": "+5491198765432",
    "email": "maria.gonzalez@example.com",
    "dni": "30456789",
    "password": "NewSecurePass123!"
  }'

Alias-Only Update

PATCH /users/update/alias/{id}
Full URL: http://localhost:8085/users/update/alias/{id} Updates only the alias field on the user record.

Authentication

Authorization: Bearer <token>

Path Parameters

id
integer
required
The numeric identifier of the user whose alias is being changed.

Request Body

alias
string
required
The new alias to assign. Must be unique across the entire platform. Aliases typically follow a three-word dot-separated format (e.g., luna.campo.verde).

Response

Returns 200 OK with a plain-text confirmation message.
Alias actualizado

Example

curl -X PATCH "http://localhost:8085/users/update/alias/42" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "alias": "luna.campo.verde"
  }'

Error Codes

HTTP StatusDescription
400 Bad RequestThe requested alias is already in use by another user (AliasAlreadyExistsException), or the new email address is already registered (EmailAlreadyRegisteredException).
401 UnauthorizedThe Authorization header is missing or the token is invalid/expired; or the authenticated user is not the owner of the target profile and does not hold ROLE_ADMIN (UnauthorizedException).
404 Not FoundNo user exists with the provided userId or id.

Build docs developers (and LLMs) love