Obtain where a user was mastered from Skip to main content
https://support.okta.com/help/answers?id=9062a000000quqtqa0&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Michael SmithMichael Smith 

Obtain where a user was mastered from

Is there an ability in the API to find out where a user is mastered from?

I am using Okta.Core.Automation and would like to delete Okta mastered users and ignore AD mastered users.
VictorVictor (Okta, Inc.) 

Hi Michael! Thank you for reaching Okta Support! You will have to run GET {{url}}/api/v1/users which lists every user in your organization. Be aware to use pagination in order to retrieve every user. You can find more about pagination here: https://developer.okta.com/docs/api/getting_started/design_principles.html. The JSON response should be filtered by credentials. If the Credentials are provided by Okta then it is Okta mastered. I am attaching a JSON response from two users (Okta mastered and AD) to see the difference.

Okta mastered user:
 { "id": "00u4dfsd2vsdsLAOUr1t7",
        "status": "PROVISIONED",
...............
        "credentials": {
            "provider": {

                "type": "OKTA",
                "name": "OKTA"

            }
        },
        "_links": {
            "self": {
                "href": }} }

AD mastered user:
 { "id": "00u2sadsyt36lIsVH1t7",
        "status": "ACTIVE",
      ...........................
         "credentials": {
            "provider": {
                "type": "ACTIVE_DIRECTORY",
                "name": "providervsuciu.com"

            }
        },
        "_links": {
            "self": {
"  } } }

Michael SmithMichael Smith
Thanks Victor!

Further information here re using the PowerShell module:
https://support.okta.com/help/answers#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Questions&criteria=ALLQUESTIONS&id=9062A000000QuQi