How to use API to bulk delete contacts quickly?
Api4 will likely to be able to do this, but it is not yet released.
It is not possible with api3. You'll need to write a custom php script to loop and call the api repeatedly, or else execute a sql query.