Help with creating a custom action in admin side

Hello,
I need to create a custom action on the admin side that will allow me to select a couple of orders and then call the action with their ids, this will further create a custom pdf with some details in it.
For the frontend part, adding a button in the bulk selection I found how to do it. But I need to now essentially create an action that can be called in the backend that will do the rest.
The docs don’t really help in that aspect, can someone point me to where I can find how I can create such an endpoint?