I attempted to delete ~9,330 unapproved devices from the device list using a CSV export from the admin panel "Devices > Mobile & Endpoints > Devices" page in the admin panel, with the status filter of "Pending approval" applied. I renamed the "Device ID" column deviceid.
gam csv ".\devices.csv" gam delete device ~deviceid doit
I receive the following errors on every single device:
ERROR: Parameter "name" value "devices/<randomstring>" does not match the pattern "^devices/[^/]+$"
API calls retry data
Quota exceeded for quota metric 'All DevicesService API write requests' and limit 'All DevicesService API write requests per minute' of service 'cloudidentity.googleapis.com' for consumer 'project_number:<projectID>'.: 42/0:08:04
Device:
devices/<randomstring>, Delete Failed: Request contains an invalid argument.
When I attempt to delete a single device, I receive:
Device: devices/<id>, Delete Failed: Request contains an invalid argument.
Using the command:
gam delete device <deviceid> doit