Mass upgrade on hundreds of Moodles - How to find library archives by script ?

Hi all

I am upgrading an old script that was intended to update massvely all H5P libraries in a moodle, and capable to bulk upgrade hundreds of moodles in one loop.

It was using the old v1 API method, which still responds on some old content-types, but which is told is not actually maintained now. So the question is how to find documentation on how to proceed to upload updated versions of the installed libraries, in order to automate mass upgrading, fix some install corruption and keep the whole stable (as stable it cans).

Now the libraries comme and cohabits in many versions. would this new proceeding need to specify upgrade for each version ? or will it only upgrade the last installed package ?

So, lot of questions about how getting a huge installed under control, what we are NOT able to get at the moment.

Cheers !