Prepare to Bulk Delete Users

Here's what you need to get started with bulk deleting users from Control Hub:

Your organization administrator credentials.

Get a personal access token from developer.webex.com .

Read https://developer.webex.com/docs/api/getting-started#accounts-and-authentication .

The reference script which is at https://github.com/mklawiter/webexControlHubScripts/blob/primary/BulkDeleteUsers.py .

About the reference script:

We provide this Python script as an example only. We do not officially support or maintain this script - or any of your scripts or API clients - but we do support the API calls used in the script.

The script is limited to remove up to 100 users, by default. You can increase the limit if necessary. This proportionally increases the time required to run the script.

If you're using Python, you'll need to install the following modules:

requests

urllib

Export your users into a CSV file.

You may need more than one CSV file if you have a large organization. See Ways to Add and Manage Users in Cisco Webex Control Hub .

Save the CSV files to the computer where you're running the script.

Open the CSV files for editing, and remove the rows that contain the users you want to keep .

You will be asked by the script to confirm the deletion of the users, so you can cancel if you make a mistake here. You could go back to Control Hub at that point and export (remaining) users into fresh CSV files.

Run the script. For example, at your shell enter python BulkDeleteUsers.py .

Enter the full path and name of your CSV file, when prompted. For example, ~/Downloads/exported_users.csv .

The script prompts you to enter your access token, so it can check whether the token is still valid to authenticate you.

Enter your access token.

The script does a dry run, returns a count of users it will delete, and asks you to confirm that you want to delete N users.

If there are any errors, it could be that the user IDs are corrupted in the CSV files.

Confirm that you want to delete the users.

The API calls required to delete each user take about two to three seconds, so you can expect the script to run for about five minutes when your CSV file has 100 users.

The script writes any errors to a CSV file in the same directory as the input files.

Repeat this process if you have more than one CSV file.