<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00007CBjwLSATOkta Classic EngineUniversal DirectoryAnswered2026-04-01T09:00:20.000Z2019-12-03T19:48:09.000Z2020-10-16T04:32:46.000Z

JamesN.83470 (Customer) asked a question.

List all user attributes via Okta API

Hi,

I'm attempting to write a custom report ​against our Okta users, utilizing the Okta API.  I find that when I GET a user, the profile properties seem to be limited only to Login, Email, FirstName, LastName, MobilePhone, and SecondaryEmail.  We have a need for additional attributes to show in the report, but I can't seem to figure out how to view things like employeeNumber, department, lastDayWork (populated from Workday via Lifecycle).

 

Is this possible?


  • t529b (t529b)

    Gabriel's powershell stuff is great (https://github.com/gabrielsroka, for anyone reading this who hasn't discovered it already). I use the powershell module and the rockstar add-in for Chrome, which saves me a lot of time.

     

    What version of the OktaAPI module are you using? I've got the 1.0.12 version, and the output from Get-OktaUser includes all the populated (non-null) profile attributes.

    Expand Post
    Selected as Best
  • ir22k (ir22k)

    I need this too. Anyone able to help ?

  • t529b (t529b)

    That hasn't been my experience. Here's a sample of the output from Postman, which uses Okta API calls to retrieve data. The output is the result of this GET : https://put.your.okta.tenant.here/api/v1/users/put.your.okta.username.here, and although it's just a partial shot of the result, it contains a mix of standard and custom attributes, including those whose value was null.

     

    Image is not available

    I don't know if that helps you at all, but I would recommend downloading Postman. It's free, and the Okta developer site has Postman collections that make it really easy to learn, experiment and develop solutions using API calls.

     

    Expand Post
  • JamesN.83470 (Customer)

    @Mike,

    You're correct, it looks like when I access via the API directly, it does indeed work correctly.  I was using the Powershell module created by Gabriel Sroka so that I could integrate it directly in a script, and that's where I was seeing that result. I'll reach out to him directly.​

  • t529b (t529b)

    Gabriel's powershell stuff is great (https://github.com/gabrielsroka, for anyone reading this who hasn't discovered it already). I use the powershell module and the rockstar add-in for Chrome, which saves me a lot of time.

     

    What version of the OktaAPI module are you using? I've got the 1.0.12 version, and the output from Get-OktaUser includes all the populated (non-null) profile attributes.

    Expand Post
    Selected as Best
  • JamesN.83470 (Customer)

    Mike...you nailed it! My version of the module was older than I realized. I updated, and now everything works exactly as I would hope.

     

    I did have to update my code to use something along the lines of

    $users = (get-oktausers -filter $filter).objects.profile

    instead of $users = (get-oktauser -filter $filter).profile

     

    but no big deal there.

     

    Thanks!

    Expand Post
  • Mike,

     

    Thanks for the nice comments. Good to hear from you again!

     

    James,

     

    What you're seeing here is that Get-OktaUsers returns a page (so you can paginate, if you have more than 200 users). The page of users is available using $page.objects

     

    There are several examples on:

    https://github.com/gabrielsroka/OktaAPI.psm1/blob/master/CallOktaAPI.ps1

    or see the code below. I've added an example to my readme file, too.

     

    Also, if you don't need PowerShell and are looking for something quicker and easier, check out:

    https://gabrielsroka.github.io/rockstar/

     

    $params = @{filter = 'status eq "ACTIVE"'}

    do {

      $page = Get-OktaUsers @params

      $users = $page.objects

      foreach ($user in $users) {

        # You can add more properties here:

        Write-Host $user.profile.login $user.profile.email

      }

      $params = @{url = $page.nextUrl}

    } while ($page.nextUrl)

    Expand Post
  • o5wof (o5wof)

    Hmm, I guess the python package needs to be updated to handle the additional fields in the json payload.

This question is closed.
Loading
List all user attributes via Okta API