demellor | Posts: 46

User Roles within Subaccounts

0 votes

We currently use subaccounts and to get the role of a user within a subaccount we have to check within each subaccount to see if they have access using the REST below

/account/senders/{senderId}/account/{subaccountId}/roles"

 

Is there a better way (since we have lots of subaccounts) to either ask for a specific user what roles they have within all possible subaccounts using a single call or within a subaccount who has what roles to avoid checking the roles of each user in each subaccount.  With almost 200 subaccounts and over 1000 users this process takes a while to check all combinations.  


Duo_Liang | Posts: 3776

Reply to: User Roles within Subaccounts

0 votes

Hi Richard,

 

It's very nice to hear from you! There are new APIs exposed in recent releases to facilitate subaccount use cases, and I believe two of them could accommodate your requirement:  

GET /api/account/senders/{senderId}/roles

Retrieves the account roles of a user across ALL subaccounts where the user has been assigned account roles.

GET /api/account/roles/{accountRoleId}/users

Within a subaccount, retrieve the user ID list who has been assigned a certain account role.

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off