---
title: "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"
method: POST
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults"
---

# POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults

`POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults`

Queries policy events for the resources under the resource group.

## Path parameters

- `policyEventsResource` 'default', required
- `subscriptionId` string, required
- `resourceGroupName` string, required

## Query parameters

- `api-version` string, required
- `$top` integer
- `$orderby` string
- `$select` string
- `$from` string, date-time
- `$to` string, date-time
- `$filter` string
- `$apply` string

## Response `200`

Query results.

- PolicyEventsQueryResults — Query results.
  - `@odata.context` string — OData context string; used by OData clients to resolve type information based on metadata.
  - `@odata.count` integer — OData entity count; represents the number of policy event records returned.
  - `value` PolicyEvent[] — Query results.
    - `@odata.id` string — OData entity ID; always set to null since policy event records do not have an entity ID.
    - `@odata.context` string — OData context string; used by OData clients to resolve type information based on metadata.
    - `timestamp` string, date-time — Timestamp for the policy event record.
    - `resourceId` string — Resource ID.
    - `policyAssignmentId` string — Policy assignment ID.
    - `policyDefinitionId` string — Policy definition ID.
    - `effectiveParameters` string — Effective parameters for the policy assignment.
    - `isCompliant` boolean — Flag which states whether the resource is compliant against the policy assignment it was evaluated against.
    - `subscriptionId` string — Subscription ID.
    - `resourceType` string — Resource type.
    - `resourceLocation` string — Resource location.
    - `resourceGroup` string — Resource group name.
    - `resourceTags` string — List of resource tags.
    - `policyAssignmentName` string — Policy assignment name.
    - `policyAssignmentOwner` string — Policy assignment owner.
    - `policyAssignmentParameters` string — Policy assignment parameters.
    - `policyAssignmentScope` string — Policy assignment scope.
    - `policyDefinitionName` string — Policy definition name.
    - `policyDefinitionAction` string — Policy definition action, i.e. effect.
    - `policyDefinitionCategory` string — Policy definition category.
    - `policySetDefinitionId` string — Policy set definition ID, if the policy assignment is for a policy set.
    - `policySetDefinitionName` string — Policy set definition name, if the policy assignment is for a policy set.
    - `policySetDefinitionOwner` string — Policy set definition owner, if the policy assignment is for a policy set.
    - `policySetDefinitionCategory` string — Policy set definition category, if the policy assignment is for a policy set.
    - `policySetDefinitionParameters` string — Policy set definition parameters, if the policy assignment is for a policy set.
    - `managementGroupIds` string — Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under.
    - `policyDefinitionReferenceId` string — Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.
    - `tenantId` string — Tenant ID for the policy event record.
    - `principalOid` string — Principal object ID for the user who initiated the resource operation that triggered the policy event.

## Other responses

- `default` — Error response describing why the operation failed.

---

[API](https://skmtc.net/azure/apis/policyeventsclient.md) · [All operations](https://skmtc.net/azure/apis/policyeventsclient/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/policyeventsclient/versions/f17411b86718/schema)
