Edit

List resourcePolicy

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.

Get a list of resourcePolicyEvaluationEvent objects that represent Entra Resource Policy (ERP) evaluation audit events for Microsoft Graph requests.

Events are retained for seven days with Microsoft Entra ID Free and 30 days with Microsoft Entra ID P1 or P2.

API availability

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet
✅ ❌ ❌ ❌

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permission Higher privileged permissions
Delegated (work or school account) ResourcePolicyEvaluationEvent.Read.All AuditLog.Read.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application ResourcePolicyEvaluationEvent.Read.All AuditLog.Read.All

Important

For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role. Reports Reader is the least privileged role supported for this operation.

HTTP request

GET /auditLogs/resourcePolicy

Optional query parameters

This method supports the $filter (eq, ge, le), $select, $top, $count, and $orderby OData query parameters. For general information, see OData query parameters.

The following table lists the properties and operators supported by $filter.

Property Supported operator
apiVersion eq
appId eq
clientRequestId eq
evaluatedDateTime eq, ge, le
id eq
operationId eq
policyDecision eq
policyDetails/assignmentUniqueName eq through policyDetails/any(...) only
requestId eq
requestMethod eq
servicePrincipalId eq
targetResourceId eq
targetResourceName eq
userId eq

Only evaluatedDateTime supports $orderby, in ascending or descending order. By default, events are ordered by evaluatedDateTime descending.

When no filter on evaluatedDateTime is specified, the response contains events from the last 24 hours. The default and maximum page size is 999 events. Follow the @odata.nextLink in the response to retrieve subsequent pages. The $skip query parameter isn't supported.

The policyDetails property isn't returned by default. Include it in $select to retrieve per-policy evaluation results.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

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

Using $skip returns a 400 Bad Request response code. Use the @odata.nextLink returned in the response instead.

Examples

Example 1: List denied requests since a specified date

Request

The following example lists denied requests evaluated on or after November 4, 2026.

GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=policyDecision eq 'deny' and evaluatedDateTime ge 2026-11-04T00:00:00Z&$top=2

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy",
  "value": [
    {
      "@odata.type": "#microsoft.graph.resourcePolicyEvaluationEvent",
      "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40",
      "evaluatedDateTime": "2026-11-04T13:42:11Z",
      "requestId": "0f9c2a1b-4d3e-4f5a-8b6c-7d8e9f0a1b2c",
      "operationId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "clientRequestId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "requestMethod": "POST",
      "apiVersion": "beta",
      "requestUri": "/beta/applications/{redacted}/addKey",
      "tenantId": "5b2c8a9e-6f10-4d7b-8c3a-2e9f0a1b4c5d",
      "appId": "7e3a9c2b-4d5f-4a6b-8c1d-0e2f3a4b5c6d",
      "appDisplayName": "Contoso Automation",
      "servicePrincipalId": "3d8f1e2a-9b7c-4d5e-8f0a-1b2c3d4e5f60",
      "userId": null,
      "targetResourceName": "application/addKey",
      "targetResourceId": null,
      "policyDecision": "deny",
      "evaluatedPoliciesCount": 4,
      "applicablePoliciesCount": 2,
      "denyPoliciesCount": 1,
      "auditPoliciesCount": 0,
      "errorPoliciesCount": 0,
      "totalPolicyEvaluationDurationMs": 18
    }
  ]
}

Example 2: Find events for a policy assignment

Request

The following example filters by a policy assignment's unique name using policyDetails/any(...). It also uses $select to include the per-policy evaluation results, which aren't returned by default. Without a filter on evaluatedDateTime, the query returns events from the last 24 hours.

GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=policyDetails/any(p:p/assignmentUniqueName eq 'block-app-key-rotation')&$select=id,policyDecision,policyDetails

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,policyDecision,policyDetails)",
  "value": [
    {
      "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40",
      "policyDecision": "deny",
      "policyDetails": [
        {
          "assignmentUniqueName": "block-app-key-rotation",
          "assignedPolicyDisplayName": "Block application key rotation",
          "appliedPolicyEffects": "deny",
          "isEnforced": true,
          "isCompliant": false,
          "isApplicable": true
        }
      ]
    }
  ]
}

Example 3: Find an application's events in a time range

Request

The following example filters by appId and a time range, orders the results from oldest to newest, and selects properties useful for investigating policy decisions. Both time boundaries are inclusive.

GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=appId eq '7e3a9c2b-4d5f-4a6b-8c1d-0e2f3a4b5c6d' and evaluatedDateTime ge 2026-11-04T13:00:00Z and evaluatedDateTime le 2026-11-04T14:00:00Z&$orderby=evaluatedDateTime asc&$select=id,evaluatedDateTime,appId,requestMethod,targetResourceName,policyDecision&$top=10

Response

The following example shows the response.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,evaluatedDateTime,appId,requestMethod,targetResourceName,policyDecision)",
  "value": [
    {
      "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40",
      "evaluatedDateTime": "2026-11-04T13:42:11Z",
      "appId": "7e3a9c2b-4d5f-4a6b-8c1d-0e2f3a4b5c6d",
      "requestMethod": "POST",
      "targetResourceName": "application/addKey",
      "policyDecision": "deny"
    }
  ]
}

Example 4: Correlate events by operation ID

Request

The following example filters by operationId to find related events, such as child operations in a $batch request, and selects request identifiers for correlation. Without a filter on evaluatedDateTime, the query returns events from the last 24 hours.

GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=operationId eq '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d'&$select=id,operationId,requestId,clientRequestId,policyDecision

Response

The following example shows the response.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,operationId,requestId,clientRequestId,policyDecision)",
  "value": [
    {
      "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40",
      "operationId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "requestId": "0f9c2a1b-4d3e-4f5a-8b6c-7d8e9f0a1b2c",
      "clientRequestId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "policyDecision": "deny"
    }
  ]
}