Bulk delete Users from the dashboard

You can use the deleteUser API call to delete a single user from the dashboard. However, it may be necessary to delete more than one user at a time.

In that case, the multi (CSV) API call needs to be used, and the list of users has to be provided via a CSV file.

Step 1: Prepare the CSV file

You can download the list of users you wish to delete straight from the dashboard.

Segment the users in the Users page, and then download them by clicking the Download button:

925

This will generate a CSV file with userIds from the selected segment, which you can then use in the multi (CSV) call:

477

If you already have a list, there is no need to download them from the dashboard, but you still need to follow the required CSV file structure.

You would need to add a header column, called userId. If you want to completely delete all session and analytics data for the selected user, you can also add a column fullErasure with value TRUE for each user.

This is the structure of the CSV, without the fullErasure option:

userId
exampleUser2
exampleUser1
exampleUser3

And this is the structure with the fullErasure option:

userIdfullErasure
exampleUser2TRUE
exampleUser1TRUE
exampleUser3TRUE

Step 2: Upload the CSV to your Leanplum Google Bucket

Your CSM will provide you with access to your Leanplum Google Bucket. You'll need to link the appropriate Google Bucket folder in your API call path.

Step 3: Construct the API call

The call should be constructed like any multi (CSV) API call, but the defaultAction parameter should be set to deleteUser:

https://api.leanplum.com/api?action=multi
&apiVersion=1.0.6
&appId={App_ID}
&clientKey={Dev_Key}
&defaultAction=deleteUser
&gcsBucket={bucket_name}
&file={path/file_name}
&createJob=true

Step 4: Monitor the uploading status

You can monitor the file the same way as any multi (CSV) import. Follow the guideline in the original article.