There are many use cases where people want to automatically delete from Matomo (e.g. for GDPR compliance). And thanks to the GDPR tools this is possible now.
But the API documentation isn't all that helpfull:
While one can guess the correct usage by taking a look at the frontend (see https://forum.matomo.org/t/scheduled-delete-filters-for-gdpr-tools/34877/4?u=lukas) a proper documentation would be helpful as this is one of the most useful API endpoints.
BTW if someone is keen to document this in a FAQ or guide the format is
array(array('idsite' => \d, 'idvisit' => \d)). So basically a matching number of idsite and idvisit. Multiple visits can be deleted in one go.
The user needs to have admin access for each site present in the array.