Orchestrator API get Roles and Permissions

Hi,

I was looking for a way to get the roles and permissions out of the orchestrator. The reason why I want that, is that we need to deliver every x months a list with al the roles and permissions. Then we check that with the IT general controls to make sure that everything is stil correct.

I want to do that with the orchestrator API, because that gives me a JSON file that I can easly export to every format I want.

Getting the roles was not hard, that just using the following API
https://url_of_the_orchestrator/odata/Roles

But that don’t give me the permission per role. The only way I found to get the permissions is using the following API
https://url_of_the_orchestrator/odata/Users/UiPath.Server.Configuration.OData.GetCurrentPermissions()

But that is only from the current user. Is there a way to get a compleet list of roles and permissions from the orchestrator?

Ok, I think I found out how I can let this work. Apparently you can add parameters to the Roles API. You will get the following thing:
https://url_of_the_orchestrator/odata/Roles?$expand=Permissions

And then the API will return all the roles and permissions in a nice JSON format.