List riskyUsers

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Retrieve the properties and relationships of a collection of riskyUser objects.

Note: Using the riskyUsers API requires an Azure AD Premium P2 license.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) IdentityRiskyUser.Read.All
Delegated (personal Microsoft account) Not supported.
Application IdentityRiskyUser.Read.All

HTTP request

GET /riskyUsers
GET /identityProtection/riskyUsers

Optional query parameters

This method supports $filter to customize the query response. See the example later in this topic.

Request headers

Name Description
Authorization Bearer {token}. Required.
Workbook-Session-Id Workbook session ID that determines whether changes are persisted. Optional.

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of riskyUser objects in the response body.

Examples

Example 1: List risky users

Request

Here is an example of the request.

GET https://graph.microsoft.com/beta/riskyUsers

Response

Here is an example of the response.

HTTP/1.1 200 OK
Content-type: application/json

{
    "value":[
        {
            "id": "c2b6c2b9-dddc-acd0-2b39-d519d803dbc3",
            "riskLastUpdatedDateTime": "2016-01-29T20:03:57.7872426Z",
            "isProcessing": true,
            "isDeleted": true,
            "riskDetail": "adminConfirmedSigninCompromised",
            "riskLevel": "high",
            "riskState": "atRisk",
            "userDisplayName": "Alex Wilbur",
            "userPrincipalName": "alexw@contoso.com"
        }
    ]
}

Example 2: List risky users and filter the results

Request

The following example shows how to use $filter to get the collection of riskyUser whose aggregate risk level is Medium.

GET https://graph.microsoft.com/beta/identityProtection/riskyUsers?$filter=riskLevel eq microsoft.graph.riskLevel'medium'

Response

Here is an example of the response.

HTTP/1.1 200 OK
Content-type: application/json

{
    "value": [
        {
            "id": "c2b6c2b9-dddc-acd0-2b39-d519d803dbc3",
            "riskLastUpdatedDateTime": "2018-09-22T00:04:49.1195968Z",
            "isProcessing": true,
            "isDeleted": false,
            "riskDetail": "none",
            "riskLevel": "medium",
            "riskState": "atRisk",
            "userDisplayName": "Alex Wilbur",
            "userPrincipalName": "alexw@contoso.com",
        }
    ]
}