Question

User profile deletion using API

  • 20 September 2019
  • 1 reply
  • 198 views

Badge

Dear all,

I'm trying to delete user profiles using the API because my account is currently over quota. I'm using the official Python client (https://developer.mixpanel.com/docs/python) to issue delete requests but it looks like they're ignored by Mixpanel. Even after sending deletion requests on almost every user profile, my account is still locked.

Does anyone know how I could fix this issue?

Thank you.



1 reply

Userlevel 3
Badge

Hey @tonioo, I shared a Python script I got from support on another post here (walks you step by step on how to run the python script). Please note the script on the other post is to update people profiles in bulk. Also, if you are trying to complete a people delete, your account has to be unblocked for the python script to be able to run.

All the steps on the previous post are relevant to run the python script, only some minor changes I would make to it is instead of calling a people.set.once at the end of the script, I would call Mixpanel's people_delete call instead. Your script would look something like this for the people delete:

from mixpanel_api import Mixpanel

if __name__ == '__main__':
    credentials = [
        {'API_secret': '',
        'token': ''}
    ]

    parameters = {'filter_by_cohort': ''}

    for project in credentials:

        i = Mixpanel(project['API_secret'],project['token'], debug=True)
        i.people_delete(query_params=parameters)

I would practice on a dummy project first before running the script being that once a change happens, it cannot be undone. Hope this helps!


Reply