<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
0D54z00008Vt2FsCAJOkta Classic EngineAPI Access ManagementAnswered2025-09-13T09:01:51.000Z2022-12-08T20:43:40.000Z2022-12-09T17:52:13.000Z

BenB.62283 (Customer) asked a question.

How to query API for Users Department?

dev.okta.url/api/v1/users/okta_user_id

 

When I send a curl request to the Users API, the returned user profile does not contain the Users Department.

How to query to find out this information? ... (title,division,department, etc)


  • DonF.81354 (Customer)

    Do you see that information on the user's profile page in the GUI? When I query the same: {url}/api/vi/users/{userid} I see the user and all of their attributes.

     

    What information is returned after the call is made as above?

  • DonF.81354 (Customer)

    Could you try this? {{url}}/api/v1/users?search=profile.department eq "IT Infrastructure"

     

    In your case, replace IT Infrastructure with the department applicable to you.

  • BenB.62283 (Customer)

    User error here....I was querying using the wrong User ID.

    • DonF.81354 (Customer)

      No worries! Thanks for following up. Hopefully you were able to catch the whole profile now.

       

      thanks!

  • a0n5s (a0n5s)

    @BenB.62283 (Customer)​ department is available in the profile by find user. title,division, not in it.

    Image is not available

    Expand Post
  • DonF.81354 (Customer)

    Does the profile tested with have values for those attributes? I am able to see even custom attributes in my API calls. Thanks!

  • BenB.62283 (Customer)

    I was accidentally quering my admin account id and not the correct user account id, which did/does not have any custom attributes associated with it. When I changed my API call using the correct user id, the attribute showed up properly in my code. I did not inspect the entire API result and I was really only testing 1 attribute ... department.

This question is closed.
Loading
How to query API for Users Department?