API request for anonymizing users

Hello.
Do we have an opportunity for anonymizing many users at the same time?
API or maybe database requests?
Thanks.

2 Likes

There is no API route to bulk anonymize users. You will need to anonymize one user at a time.

2 Likes

One could do it at the rails console. You’d need to read the code to find out what the call is, then loop through the users you want to make anonymous.

Well, I got curious and there was a link to the code the other topic you were discussing this in.

Something like:

users=User.where(some way to get users--maybe add them all to a group)
users.each do |user|
  a=UserAnonymizer.new(user)
  a.make_anonymous
end
7 Likes