Cockpit Plugin Retry Implementation

Hello!

I want to implement the following functionality:
In the Camunda Cockpit, I want to have a button. This button should be doing Batch Retries, so all of the failed instances of specific processes should be retried.

This is what I did:
I implemented this functionality with a Camunda Cockpit Plugin. In this plugin, I have some code, which is setting off a POST request to the Camunda REST API

The following endpoint is called:
http://localhost:8080/engine-rest/process-instance/job-retries

Here are two of my projects with the implementation:
Plugin:
GitHub - cz2803/camunda-cockpit-plugin
Camunda with plugin:
GitHub - cz2803/camunda-with-cockpit-plugin

Problem:
We have a deployment aware setup, in which we have two separate engines containing the Cockpit and the REST API.

Because of this, I made the following finding:
I saw in the Network section of the developer tools of Google Chrome, that Camunda Cockpit is using a different endpoint to trigger these retries. (I first assumed that the cockpit is doing it over the REST API)

The Cockpit is doing a POST request to the following endpoint (Endpoint is located in the engine with the Cockpit and not in the engine with the REST API):
http://localhost:8080/camunda/api/engine/engine/default/process-instance/job-retries-historic-query-based

Since we have different environments where the REST API has different URLs, it would be the easiest to do it like Camunda, over the endpoint of the Cockpit.
Is there a way to trigger those endpoints from the Cockpit? If yes, do you have an example?

Since Camunda is doing it over the endpoint mentioned above, I wanted to know if my approach is valid, or if not how to call this endpoint and implement it correctly.