How to delete a user from multiple tenants using a single endpoint call in FusionAuth?
-
Hello FusionAuth community,
I have configured multiple tenants in my FusionAuth instance, and I'm using FusionAuth for security purposes and storing user data. I have a scenario where a user can exist in multiple tenants, and I need to delete that user from all tenants simultaneously using a single API endpoint call.
Currently, I am using the "DELETE /api/user/{userId}?hardDelete=true" endpoint to delete the user. However, this endpoint only deletes the user from a single tenant, and I'm not passing the X-FusionAuth-TenantId in the request header, so its scope is global.
Is there an available endpoint in FusionAuthClient or an alternative approach that would allow me to delete a user from all tenants at once using a single API call?
Thank you for your assistance.
-
Hiya @anirudh-vekariya!
There is no way to do this.
Since tenants are designed to be logically separate, FusionAuth has no concept of a user that spans tenants. I would not expect this to be something to be built into FusionAuth because of that.
Hope this helps.