Your production cluster has over 155k device entries that have none of the three device types set. You get this list from the Devices > Manage Devices page when filtering on column Device Type with value Not Configured. You want to remove these devices. Your understanding is that this can be accomplished using Rest API calls and you are looking for a sample script that demonstrates the Rest API calls you should be using for this purpose.
Attached is a sample UNIX/Linux shell script that finds devices with all types set to false ("f"), and in a second run deletes those devices using Rest API calls.