Remove all user data

Hello,
I’m trying to make a function where all the user data like the posts get delete when a user delete his account. But i cant find a solution where the user can delete its own data. Only where an operator or admin it does.

Is there a way where the user is able to delete al is data at amity and if so what is the best way to do so ?

Hi @mika when the user want to delete their data, you can make it as a request and call this api Amity API please note that you will need admin permission to proceed this.

Hey @amitysupport ,
Thanks for the reply

But I’m trying to avoid giving users admin permission.
What I’m trying to do is to build a function called delete account.
With this, the user should be able to delete his account end all his posts, comments, reactions etc.
I need this in my app because of legal reasons.

This function should delete all the content created by the user.

So, what would be the best way to remove all the data of a user who has a standard account. Where the user with that account would be able to trigger the function. Without changing the role or having someone else with a higher rank, deleting this account and data.

Hi Mika, apologies if my explanation wasn’t cleared. In this case, users don’t have to be promoted/changed roles. You have to implement a backend function for receiving a request from the frontend when users wish to delete their account/data. Then, let your backend to call delete user API with Admin Token to authorize this action.

1 Like