Check whether a user can be pseudonymized
Before you submit a GDPR erasure request, MobilityManager lets you check whether the target account is eligible for pseudonymization. This validation runs the same rules as the erasure itself but changes nothing, so you can confirm eligibility from your interface before committing. This article explains how to run the check and what each result means.
Required role and permission
The eligibility check requires the users:manage permission. Like the erasure operation, it also confirms that your account holds the SystemAdmin role.
How to run the check
- Identify the user ID you want to test.
- Call
GET /api/gdpr/can-pseudonymize/{userId}. - Read the response:
canPseudonymizeistruewhen the account is eligible, orfalsewith anerrorMessageexplaining why not.
Tip: Always run this check first. It prevents failed erasure requests and gives you a clear reason to communicate back to the person who raised the request.
Reasons a user cannot be pseudonymized
The check returns false in the following cases:
| Result message | Meaning |
|---|---|
| Cannot pseudonymize your own user account | You cannot erase the account you are signed in with. Ask another SystemAdmin to process it. |
| Forbidden: requesting user must be a SystemAdmin to pseudonymize users | Your account does not hold the SystemAdmin role, so the operation is blocked even if you have users:manage. |
| User not found | No user exists with that ID. |
| Cannot pseudonymize a SystemAdmin user. Remove SystemAdmin role first. | The target account is itself a SystemAdmin. Remove that role before erasing. |
| User has already been pseudonymized | The account's email or username already begins with Deleted User #, so there is nothing left to scrub. |
What a positive result means
When canPseudonymize is true, the account can proceed to erasure. The check validates eligibility only — no personal data is changed until you submit the actual pseudonymization request.
Note: If a SystemAdmin needs to be erased, first remove the SystemAdmin role from their account, then re-run this check. Once the role is gone, the account becomes eligible.
Related
- Pseudonymize a user (GDPR right to erasure)
- Who can run GDPR actions
- GDPR compliance in MobilityManager