Users - List

Get a list of all users in a given scope.

Since the list of users may be large, results are returned in pages of users. If there are more results than can be returned in a single page, the result set will contain a continuation token for retrieval of the next set of results.

GET https://vssps.dev.azure.com/{organization}/_apis/graph/users?api-version=6.1-preview.1
GET https://vssps.dev.azure.com/{organization}/_apis/graph/users?subjectTypes={subjectTypes}&continuationToken={continuationToken}&scopeDescriptor={scopeDescriptor}&api-version=6.1-preview.1

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

api-version
query True

string

Version of the API to use. This should be set to '6.1-preview.1' to use this version of the api.

continuationToken
query

string

An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token.

scopeDescriptor
query

string

Specify a non-default scope (collection, project) to search for users.

subjectTypes
query

string

array (string)

A comma separated list of user subject subtypes to reduce the retrieved results, e.g. msa’, ‘aad’, ‘svc’ (service identity), ‘imp’ (imported identity), etc.

Responses

Name Type Description
200 OK

GraphUser[]

successful operation

Headers

X-MS-ContinuationToken: string

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.graph Grants the ability to read user, group, scope and group membership information

Examples

Sample Request

GET https://vssps.dev.azure.com/{organization}/_apis/graph/users?api-version=6.1-preview.1

Sample Response

{
  "count": 5,
  "value": [
    {
      "subjectKind": "user",
      "metaType": "member",
      "domain": "LOCAL AUTHORITY",
      "principalName": "TeamFoundationService (TEAM FOUNDATION)",
      "mailAddress": "",
      "origin": "vsts",
      "originId": "00ca946b-2fe9-4f2a-ae2f-40d5c48001bc",
      "displayName": "TeamFoundationService (TEAM FOUNDATION)",
      "_links": {
        "self": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj"
        },
        "memberships": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj"
        },
        "membershipState": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/MembershipStates/acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj"
        },
        "storageKey": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/StorageKeys/acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj"
        },
        "avatar": {
          "href": "https://dev.azure.com/Fabrikam/_apis/GraphProfile/MemberAvatars/acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj"
        }
      },
      "url": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj",
      "descriptor": "acs.Nzc4OWYwOWQtZTA1My00ZjJlLWJkZWUtMGM4Zjg0NzZhNGJj"
    },
    {
      "subjectKind": "user",
      "metaType": "guest",
      "domain": "45aa3d2d-7442-473d-b4d3-3c670da9dd96",
      "principalName": "fabrikamfiber4@hotmail.com",
      "mailAddress": "fabrikamfiber4@hotmail.com",
      "origin": "aad",
      "originId": "ddddb7d1-2de3-4bab-98b6-ddcc994e964d",
      "displayName": "Jamal Hartnett",
      "_links": {
        "self": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2"
        },
        "memberships": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2"
        },
        "membershipState": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/MembershipStates/aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2"
        },
        "storageKey": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/StorageKeys/aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2"
        },
        "avatar": {
          "href": "https://dev.azure.com/Fabrikam/_apis/GraphProfile/MemberAvatars/aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2"
        }
      },
      "url": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2",
      "descriptor": "aad.YWZkMzM2ZGQtZTgwYy03MWViLThlYmQtODMzNjMxYmEwNWM2"
    },
    {
      "subjectKind": "user",
      "metaType": "member",
      "domain": "45aa3d2d-7442-473d-b4d3-3c670da9dd96",
      "principalName": "ftotten@vscsi.us",
      "mailAddress": "ftotten@vscsi.us",
      "origin": "aad",
      "originId": "4be8f294-000d-4431-8506-57420b88e204",
      "displayName": "Francis Totten",
      "_links": {
        "self": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5"
        },
        "memberships": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5"
        },
        "membershipState": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/MembershipStates/aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5"
        },
        "storageKey": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/StorageKeys/aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5"
        },
        "avatar": {
          "href": "https://dev.azure.com/Fabrikam/_apis/GraphProfile/MemberAvatars/aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5"
        }
      },
      "url": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5",
      "descriptor": "aad.NjU5MDNmOTItNTNkYy03MWIzLWJiMGUtZTY5Y2ZhMWNiNzE5"
    },
    {
      "subjectKind": "user",
      "metaType": "member",
      "domain": "45aa3d2d-7442-473d-b4d3-3c670da9dd96",
      "principalName": "jmarks@vscsi.us",
      "mailAddress": "jmarks@vscsi.us",
      "origin": "aad",
      "originId": "f867eff7-2024-49b4-9626-25777ae370f6",
      "displayName": "Justin VSCSI AAD",
      "_links": {
        "self": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj"
        },
        "memberships": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj"
        },
        "membershipState": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/MembershipStates/aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj"
        },
        "storageKey": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/StorageKeys/aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj"
        },
        "avatar": {
          "href": "https://dev.azure.com/Fabrikam/_apis/GraphProfile/MemberAvatars/aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj"
        }
      },
      "url": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj",
      "descriptor": "aad.NGRkODVlNDctOGM1MS03MTZlLTljZGUtZjA3Yjc0NDU0ZWFj"
    },
    {
      "subjectKind": "user",
      "domain": "Build",
      "principalName": "10feb381-82c3-4902-8e1f-840299a48ae4",
      "mailAddress": "",
      "origin": "vsts",
      "originId": "ca261b38-d22b-4b13-b0d8-f6b8cbe16f90",
      "displayName": "Project Collection Build Service (Fabrikam)",
      "_links": {
        "self": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA"
        },
        "memberships": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA"
        },
        "membershipState": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/MembershipStates/svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA"
        },
        "storageKey": {
          "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/StorageKeys/svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA"
        },
        "avatar": {
          "href": "https://dev.azure.com/Fabrikam/_apis/GraphProfile/MemberAvatars/svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA"
        }
      },
      "url": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Users/svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA",
      "descriptor": "svc.OWI0ZjczMzYtYzEzMC00MGJkLTg3ZjMtNDIwMTM2MWRkYmQxOkJ1aWxkOjEwZmViMzgxLTgyYzMtNDkwMi04ZTFmLTg0MDI5OWE0OGFlNA"
    }
  ]
}

Definitions

Name Description
GraphUser

Graph user entity

ReferenceLinks

The class to represent a collection of REST reference links.

GraphUser

Graph user entity

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor

string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

directoryAlias

string

The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle.

displayName

string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

domain

string

This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc)

isDeletedInOrigin

boolean

When true, the group has been deleted in the identity provider

legacyDescriptor

string

[Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor.

mailAddress

string

The email address of record for a given graph member. This may be different than the principal name.

metaType

string

The meta type of the user in the origin, such as "member", "guest", etc. See UserMetaType for the set of possible values.

origin

string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId

string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

principalName

string

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

subjectKind

string

This field identifies the type of the graph subject (ex: Group, Scope, User).

url

string

This url is the full route to the source resource of this graph subject.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.