In my case bitbucket APIs are not so useful to deregister runners.
I have a repo and multiple steps in repo are using selfhost docker runner label and running simultaneosly in different vms using vm azure scale set.
vm get spinned up only when job runs and should get deleted once job completes and docker runner self drains.
Since docker runner does not self exits it is bit hard to watch out pipelines and go to scaleset and shut down vms
Kindly assist
Regards,
Arun