|
| 1 | +--- |
| 2 | +title: "List resourcePolicy" |
| 3 | +description: "Get Entra Resource Policy evaluation audit events for Microsoft Graph requests." |
| 4 | +author: "milanevk" |
| 5 | +ms.date: 11/04/2026 |
| 6 | +ms.localizationpriority: medium |
| 7 | +ms.subservice: "entra-monitoring-health" |
| 8 | +doc_type: apiPageType |
| 9 | +--- |
| 10 | + |
| 11 | +# List resourcePolicy |
| 12 | + |
| 13 | +Namespace: microsoft.graph |
| 14 | + |
| 15 | +[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] |
| 16 | + |
| 17 | +Get a list of [resourcePolicyEvaluationEvent](../resources/resourcepolicyevaluationevent.md) objects that represent Entra Resource Policy (ERP) evaluation audit events for Microsoft Graph requests. |
| 18 | + |
| 19 | +Events are retained for seven days with Microsoft Entra ID Free and 30 days with Microsoft Entra ID P1 or P2. |
| 20 | + |
| 21 | +## Permissions |
| 22 | + |
| 23 | +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](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference). |
| 24 | + |
| 25 | +<!-- { |
| 26 | + "blockType": "permissions", |
| 27 | + "name": "auditlogroot-list-resourcepolicy-permissions" |
| 28 | +} |
| 29 | +--> |
| 30 | +[!INCLUDE [permissions-table](../includes/permissions/auditlogroot-list-resourcepolicy-permissions.md)] |
| 31 | + |
| 32 | +[!INCLUDE [rbac-resource-policy-evaluation-apis-read](../includes/rbac-for-apis/rbac-resource-policy-evaluation-apis-read.md)] |
| 33 | + |
| 34 | +## HTTP request |
| 35 | + |
| 36 | +<!-- { |
| 37 | + "blockType": "ignored" |
| 38 | +} |
| 39 | +--> |
| 40 | +``` http |
| 41 | +GET /auditLogs/resourcePolicy |
| 42 | +``` |
| 43 | + |
| 44 | +## Optional query parameters |
| 45 | + |
| 46 | +This method supports the `$filter` (`eq`, `ge`, `le`), `$select`, `$top`, `$count`, and `$orderby` OData query parameters. For general information, see [OData query parameters](/graph/query-parameters). |
| 47 | + |
| 48 | +The following table lists the properties and operators supported by `$filter`. |
| 49 | + |
| 50 | +|Property|Supported operator| |
| 51 | +|:---|:---| |
| 52 | +|**apiVersion**|`eq`| |
| 53 | +|**appId**|`eq`| |
| 54 | +|**clientRequestId**|`eq`| |
| 55 | +|**evaluatedDateTime**|`eq`, `ge`, `le`| |
| 56 | +|**id**|`eq`| |
| 57 | +|**operationId**|`eq`| |
| 58 | +|**policyDecision**|`eq`| |
| 59 | +|**policyDetails/assignmentUniqueName**|`eq` through `policyDetails/any(...)` only| |
| 60 | +|**requestId**|`eq`| |
| 61 | +|**requestMethod**|`eq`| |
| 62 | +|**servicePrincipalId**|`eq`| |
| 63 | +|**targetResourceId**|`eq`| |
| 64 | +|**targetResourceName**|`eq`| |
| 65 | +|**userId**|`eq`| |
| 66 | + |
| 67 | +Only **evaluatedDateTime** supports `$orderby`, in ascending or descending order. By default, events are ordered by **evaluatedDateTime** descending. |
| 68 | + |
| 69 | +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. |
| 70 | + |
| 71 | +The **policyDetails** property isn't returned by default. Include it in `$select` to retrieve per-policy evaluation results. |
| 72 | + |
| 73 | +## Request headers |
| 74 | + |
| 75 | +|Name|Description| |
| 76 | +|:---|:---| |
| 77 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 78 | + |
| 79 | +## Request body |
| 80 | + |
| 81 | +Don't supply a request body for this method. |
| 82 | + |
| 83 | +## Response |
| 84 | + |
| 85 | +If successful, this method returns a `200 OK` response code and a collection of [resourcePolicyEvaluationEvent](../resources/resourcepolicyevaluationevent.md) objects in the response body. |
| 86 | + |
| 87 | +Using `$skip` returns a `400 Bad Request` response code. Use the `@odata.nextLink` returned in the response instead. |
| 88 | + |
| 89 | +## Examples |
| 90 | + |
| 91 | +### Example 1: List denied requests since a specified date |
| 92 | + |
| 93 | +#### Request |
| 94 | + |
| 95 | +The following example lists denied requests evaluated on or after November 4, 2026. |
| 96 | + |
| 97 | +<!-- { |
| 98 | + "blockType": "request", |
| 99 | + "name": "list_resourcepolicyevaluationevent" |
| 100 | +} |
| 101 | +--> |
| 102 | +``` http |
| 103 | +GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=policyDecision eq 'deny' and evaluatedDateTime ge 2026-11-04T00:00:00Z&$top=2 |
| 104 | +``` |
| 105 | + |
| 106 | +#### Response |
| 107 | + |
| 108 | +The following example shows the response. |
| 109 | + |
| 110 | +> **Note:** The response object shown here might be shortened for readability. |
| 111 | +
|
| 112 | +<!-- { |
| 113 | + "blockType": "response", |
| 114 | + "truncated": true, |
| 115 | + "isCollection": true, |
| 116 | + "@odata.type": "microsoft.graph.resourcePolicyEvaluationEvent" |
| 117 | +} |
| 118 | +--> |
| 119 | +``` http |
| 120 | +HTTP/1.1 200 OK |
| 121 | +Content-Type: application/json |
| 122 | +
|
| 123 | +{ |
| 124 | + "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy", |
| 125 | + "value": [ |
| 126 | + { |
| 127 | + "@odata.type": "#microsoft.graph.resourcePolicyEvaluationEvent", |
| 128 | + "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40", |
| 129 | + "evaluatedDateTime": "2026-11-04T13:42:11Z", |
| 130 | + "requestId": "0f9c2a1b-4d3e-4f5a-8b6c-7d8e9f0a1b2c", |
| 131 | + "operationId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", |
| 132 | + "clientRequestId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", |
| 133 | + "requestMethod": "POST", |
| 134 | + "apiVersion": "beta", |
| 135 | + "requestUri": "/beta/applications/{redacted}/addKey", |
| 136 | + "tenantId": "5b2c8a9e-6f10-4d7b-8c3a-2e9f0a1b4c5d", |
| 137 | + "appId": "7e3a9c2b-4d5f-4a6b-8c1d-0e2f3a4b5c6d", |
| 138 | + "appDisplayName": "Contoso Automation", |
| 139 | + "servicePrincipalId": "3d8f1e2a-9b7c-4d5e-8f0a-1b2c3d4e5f60", |
| 140 | + "userId": null, |
| 141 | + "targetResourceName": "application/addKey", |
| 142 | + "targetResourceId": null, |
| 143 | + "policyDecision": "deny", |
| 144 | + "evaluatedPoliciesCount": 4, |
| 145 | + "applicablePoliciesCount": 2, |
| 146 | + "denyPoliciesCount": 1, |
| 147 | + "auditPoliciesCount": 0, |
| 148 | + "errorPoliciesCount": 0, |
| 149 | + "totalPolicyEvaluationDurationMs": 18 |
| 150 | + } |
| 151 | + ] |
| 152 | +} |
| 153 | +``` |
| 154 | + |
| 155 | +### Example 2: Find events for a policy assignment |
| 156 | + |
| 157 | +#### Request |
| 158 | + |
| 159 | +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. |
| 160 | + |
| 161 | +<!-- { |
| 162 | + "blockType": "request", |
| 163 | + "name": "list_resourcepolicyevaluationevent_by_assignment" |
| 164 | +} |
| 165 | +--> |
| 166 | +``` http |
| 167 | +GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=policyDetails/any(p:p/assignmentUniqueName eq 'block-app-key-rotation')&$select=id,policyDecision,policyDetails |
| 168 | +``` |
| 169 | + |
| 170 | +#### Response |
| 171 | + |
| 172 | +The following example shows the response. |
| 173 | + |
| 174 | +> **Note:** The response object shown here might be shortened for readability. |
| 175 | +
|
| 176 | +<!-- { |
| 177 | + "blockType": "response", |
| 178 | + "truncated": true, |
| 179 | + "isCollection": true, |
| 180 | + "@odata.type": "microsoft.graph.resourcePolicyEvaluationEvent" |
| 181 | +} |
| 182 | +--> |
| 183 | +``` http |
| 184 | +HTTP/1.1 200 OK |
| 185 | +Content-Type: application/json |
| 186 | +
|
| 187 | +{ |
| 188 | + "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,policyDecision,policyDetails)", |
| 189 | + "value": [ |
| 190 | + { |
| 191 | + "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40", |
| 192 | + "policyDecision": "deny", |
| 193 | + "policyDetails": [ |
| 194 | + { |
| 195 | + "assignmentUniqueName": "block-app-key-rotation", |
| 196 | + "assignedPolicyDisplayName": "Block application key rotation", |
| 197 | + "appliedPolicyEffects": "deny", |
| 198 | + "isEnforced": true, |
| 199 | + "isCompliant": false, |
| 200 | + "isApplicable": true |
| 201 | + } |
| 202 | + ] |
| 203 | + } |
| 204 | + ] |
| 205 | +} |
| 206 | +``` |
| 207 | + |
| 208 | +### Example 3: Find an application's events in a time range |
| 209 | + |
| 210 | +#### Request |
| 211 | + |
| 212 | +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. |
| 213 | + |
| 214 | +<!-- { |
| 215 | + "blockType": "request", |
| 216 | + "name": "list_resourcepolicyevaluationevent_by_app_and_time" |
| 217 | +} |
| 218 | +--> |
| 219 | +``` http |
| 220 | +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 |
| 221 | +``` |
| 222 | + |
| 223 | +#### Response |
| 224 | + |
| 225 | +The following example shows the response. |
| 226 | + |
| 227 | +<!-- { |
| 228 | + "blockType": "response", |
| 229 | + "truncated": true, |
| 230 | + "isCollection": true, |
| 231 | + "@odata.type": "microsoft.graph.resourcePolicyEvaluationEvent" |
| 232 | +} |
| 233 | +--> |
| 234 | +``` http |
| 235 | +HTTP/1.1 200 OK |
| 236 | +Content-Type: application/json |
| 237 | +
|
| 238 | +{ |
| 239 | + "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,evaluatedDateTime,appId,requestMethod,targetResourceName,policyDecision)", |
| 240 | + "value": [ |
| 241 | + { |
| 242 | + "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40", |
| 243 | + "evaluatedDateTime": "2026-11-04T13:42:11Z", |
| 244 | + "appId": "7e3a9c2b-4d5f-4a6b-8c1d-0e2f3a4b5c6d", |
| 245 | + "requestMethod": "POST", |
| 246 | + "targetResourceName": "application/addKey", |
| 247 | + "policyDecision": "deny" |
| 248 | + } |
| 249 | + ] |
| 250 | +} |
| 251 | +``` |
| 252 | + |
| 253 | +### Example 4: Correlate events by operation ID |
| 254 | + |
| 255 | +#### Request |
| 256 | + |
| 257 | +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. |
| 258 | + |
| 259 | +<!-- { |
| 260 | + "blockType": "request", |
| 261 | + "name": "list_resourcepolicyevaluationevent_by_operation" |
| 262 | +} |
| 263 | +--> |
| 264 | +``` http |
| 265 | +GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy?$filter=operationId eq '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d'&$select=id,operationId,requestId,clientRequestId,policyDecision |
| 266 | +``` |
| 267 | + |
| 268 | +#### Response |
| 269 | + |
| 270 | +The following example shows the response. |
| 271 | + |
| 272 | +<!-- { |
| 273 | + "blockType": "response", |
| 274 | + "truncated": true, |
| 275 | + "isCollection": true, |
| 276 | + "@odata.type": "microsoft.graph.resourcePolicyEvaluationEvent" |
| 277 | +} |
| 278 | +--> |
| 279 | +``` http |
| 280 | +HTTP/1.1 200 OK |
| 281 | +Content-Type: application/json |
| 282 | +
|
| 283 | +{ |
| 284 | + "@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,operationId,requestId,clientRequestId,policyDecision)", |
| 285 | + "value": [ |
| 286 | + { |
| 287 | + "id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40", |
| 288 | + "operationId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", |
| 289 | + "requestId": "0f9c2a1b-4d3e-4f5a-8b6c-7d8e9f0a1b2c", |
| 290 | + "clientRequestId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", |
| 291 | + "policyDecision": "deny" |
| 292 | + } |
| 293 | + ] |
| 294 | +} |
| 295 | +``` |
0 commit comments