The Update User endpoint allows an authenticated user to change their own username. Only theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt
Use this file to discover all available pages before exploring further.
nombre field is acted upon by the server — the password and email values are accepted by UsuarioEntradaDTO but are not processed by this endpoint. However, because @Valid validation is applied and all three fields carry @NotBlank constraints in the DTO, the request body must include nombre, password, and email or the server will respond with 400 Bad Request. Extra fields not declared on the DTO are silently discarded thanks to @JsonIgnoreProperties(ignoreUnknown = true).
The new username must be between 6 and 20 characters. Internally, updating nombre also propagates the change to the associated Participante profile via the cambiarNombre() method on the Usuario entity, keeping both records in sync.
Endpoint
Authorization header. Although /api/usuarios/** is listed as permitAll() in the security configuration, the endpoint logic calls AuthDataService to resolve the authenticated user and will fail if no valid principal is present.
Headers
A valid JWT access token obtained from the authentication endpoint. Must follow the
Bearer <accessToken> scheme.Example: Bearer eyJhbGciOiJIUzI1NiJ9...Request body
The request body must be valid JSON. All three fields declared onUsuarioEntradaDTO carry @NotBlank validation constraints and must be present, even though only nombre is used when updating the account.
The new username for the authenticated account. Must be between 6 and 20 characters (inclusive). Must be unique — no other registered user may already have this username.
Must be provided to pass DTO validation. Must be at least 8 characters and contain at least one digit. This value is not used to change the account’s password.
Must be provided to pass DTO validation. Must be a valid email address format. This value is not used to change the account’s email.
Example request body
Response
Returns the updated user as aUsuarioSalidaDTO object.
The user’s updated username.
The user’s email address (unchanged by this endpoint).
Example response
Error responses
| HTTP status | Condition |
|---|---|
400 Bad Request | Validation failure — a required field is blank, nombre is fewer than 6 or more than 20 characters, password is fewer than 8 characters or lacks a digit, or email is not a valid address. |
404 Not Found | The authenticated user could not be located in the database. |
401 Unauthorized | The Authorization header is missing, the token has expired, or the token signature is invalid. |
Example error response body
Example request
This endpoint also updates the associated
Participante record’s display name. The cambiarNombre() method on the Usuario entity checks whether a linked participant exists and, if so, sets nombreParticipante to the same value, ensuring both the authentication identity and the community profile stay in sync.