List all Super Organization Administrator via API

Is there a way to get a list of all Super Organization Administrators using the API?
My use case is trying to locate Administrators that are outside my specific group. So unfortunately using the group API endpoint as was suggested to me here doesn’t work.

An old question suggests no easy way for this.

Any suggestions? Thanks in advance.

How is this not a thing???
Did no one think that a list of known admins would be useful?

ARGH!

I know this isn’t using the API but could you just download the “Admin role assignments” report?
Screen Shot 2022-03-23 at 9.19.30 AM

If you need to get the user id then you could use the Users API with the login field from the report.

Hi @warren,

Thanks for the good advice.
I need this to be fully automated, that is why I asked for an API solution. So sadly, your good solution won’t work for me.

1 Like

So…this works…but depending on your instance size, could be slow.

I used to run all my code in python, but I converted it over to powershell so that other admins could leverage it.

Assuming ‘getHTML’ is your function to send/recv api stuff from Okta:

$users = getHTML -uri “https://kars4kids.okta.com/api/v1/users?filter=status+eq+“ACTIVE”
foreach ($user in $users) {
$userRoles = getHTML -uri “https://kars4kids.okta.com/api/v1/users/$($user.id)/roles
if ($userRoles.label) {
$roles = $userRoles.label -join “,”
“{0}t{1}t{2}t{3}t{4}” -f $user.profile.login,$user.id,$user.lastLogin,$user.passwordChanged,$roles >> roles.tsv
}
}

  1. Query Okta for all active users
  2. Loop through and query /api/v1/users/USERID/roles for each and every user.
  3. If they have a role, data is returned…so parse it

Wow. This is really creative. Thank you!
I appreciate you sharing this, and hope Okta will add an API endpoint for this in the future.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.