Skip to main content
Box Employee
May 22, 2025 7:18 AM UTC
Question

Bulk delete users in CLI using CSV file

Hi, I need to do a bulk delete of a few hundred users using the CLI. The "Commands and Actions" page suggests a method to do this using a JSON file; however, I have everything in a CSV already, and I really don't want to convert it. The page further states "CSV files are also supported for bulk actions, but require special CSV templates."

 

I've been searching for those special templates, but can't find them. What is the proper format for bulk deleting users using a CSV file?

 

Thanks in advance!

    3 replies

    Box Employee
    May 22, 2025 7:18 AM UTC

    Hey , 

     

    Thanks so much for using our platform and development forum! 

     

    Here are some templates: https://cloud.app.box.com/s/pmtx7ho4abpbqkylkiw8g7ycji7cpegz

     

    Best, 

    Translate
    Box Employee
    May 22, 2025 7:18 AM UTC

    Thanks very much. I didn't see a template for DeleteUsers, but the CSV template for DeleteCollaborators worked.

     

    Essentially, the CSV file just needs a single column with the header Id, which lists the numeric IDs of the accounts to be deleted. Then the command below will delete the users and all their data:

     

    box users delete --bulk-file-path "c:\path\to\file.csv" -y -f

     

    Thanks again!

    Translate
    Box Employee
    May 22, 2025 7:18 AM UTC

    box users delete --bulk-file-path "c:\path\to\file.csv" -y -f

     

    where to run this cmd ?? 

    Translate