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 bearingDocumentation 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.
ROLE_ADMIN may invoke this endpoint.
Endpoint
http://localhost:8085
Full URL: http://localhost:8085/users/delete/{userId}
Authentication
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
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 returns200 OK with a plain-text body confirming the action.
Example
Response Body
Error Codes
| HTTP Status | Description |
|---|---|
401 Unauthorized | The 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 Found | No user exists with the provided userId. |
