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.

Permanently removes a user from the Digital Money House platform. When deletion succeeds, the User Service cascades the operation to the Auth Service (removing the authentication record) and to the Accounts Service (removing the associated digital account and its transaction history). This action cannot be undone via the API. Only the account owner or a principal bearing ROLE_ADMIN may invoke this endpoint.

Endpoint

DELETE /users/delete/{userId}
Base URL: http://localhost:8085 Full URL: http://localhost:8085/users/delete/{userId}

Authentication

Authorization: Bearer <token>
The JWT must be present and valid. The service extracts the calling user’s email from the token, looks up the corresponding User record, and verifies that either the record’s id matches userId (owner) or the principal’s authorities include ROLE_ADMIN. Any mismatch results in 401 Unauthorized — the service throws UnauthorizedException, which is mapped to 401 by GlobalExceptionHandler.

Path Parameters

userId
integer
required
The unique numeric identifier of the user to delete. This corresponds to the auto-generated primary key in the user table.

Response

A successful deletion returns 200 OK with a plain-text body confirming the action.
Usuario eliminado
This operation is irreversible. Deleting a user permanently removes the user profile, authentication credentials, and the associated digital account — including all transaction history. There is no soft-delete or recovery mechanism. Ensure the client application presents an appropriate confirmation dialog before calling this endpoint.

Example

curl -X DELETE "http://localhost:8085/users/delete/42" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9..."

Response Body

Usuario eliminado

Error Codes

HTTP StatusDescription
401 UnauthorizedThe Authorization header is missing or the JWT is invalid/expired; or the authenticated user is neither the owner of the target account nor an admin (UnauthorizedException).
404 Not FoundNo user exists with the provided userId.

Build docs developers (and LLMs) love