| title | List directoryAudits |
|---|---|
| description | Get the list of audit logs generated by Microsoft Entra ID. |
| ms.localizationpriority | medium |
| author | egreenberg14 |
| ms.subservice | entra-monitoring-health |
| doc_type | apiPageType |
| ms.date | 11/08/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get the list of audit logs generated by Microsoft Entra ID. This includes audit logs generated by various services within Microsoft Entra ID, including user, app, device and group Management, privileged identity management (PIM), access reviews, terms of use, identity protection, password management (SSPR and admin password resets), and self service group management.
[!INCLUDE national-cloud-support]
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.
[!INCLUDE permissions-table]
[!INCLUDE rbac-directoryaudit-apis]
GET /auditLogs/directoryAuditsThis method supports the $filter (eq, ge, le, startswith), $top, $orderby, and skiptoken OData query parameters to help customize the response. For general information, see OData query parameters.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a collection of directoryAudit objects in the response body.
The following example shows a request.
GET https://graph.microsoft.com/beta/auditLogs/directoryAudits
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
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
{
"id": "Directory_504a302a-8f2d-418d-b7df-bf77de6ed831_M1N6X_27777783",
"category": "UserManagement",
"correlationId": "504a302a-8f2d-418d-b7df-bf77de6ed831",
"result": "success",
"resultReason": "",
"activityDisplayName": "Update user",
"activityDateTime": "2022-06-21T23:25:00.1458248Z",
"loggedByService": "Core Directory",
"operationType": "Update",
"userAgent": null,
"initiatedBy": {
"app": null,
"user": {
"id": "2c940657-1026-4386-bcfd-3176637ba01f",
"displayName": "Test Admin",
"userPrincipalName": "tadmin@contoso.com",
"ipAddress": "",
"userType": "Member",
"homeTenantId": null,
"homeTenantName": null
}
},
"targetResources": [
{
"id": "2c940657-1026-4386-bcfd-3176637ba01f",
"displayName": "Test User",
"type": "User",
"userPrincipalName": "tuser@contoso.com",
"groupType": null,
"modifiedProperties": [
{
"displayName": "StrongAuthenticationMethod",
"oldValue": "[{\"MethodType\":6,\"Default\":true},{\"MethodType\":7,\"Default\":false}]",
"newValue": "[{\"MethodType\":7,\"Default\":false},{\"MethodType\":6,\"Default\":true},{\"MethodType\":0,\"Default\":false},{\"MethodType\":5,\"Default\":false}]"
},
{
"displayName": "Included Updated Properties",
"oldValue": null,
"newValue": "\"StrongAuthenticationMethod\""
},
{
"displayName": "TargetId.UserType",
"oldValue": null,
"newValue": "\"Member\""
}
]
}
],
"additionalDetails": [
{
"key": "UserType",
"value": "Member"
}
]
}The following example shows a request.
GET https://graph.microsoft.com/beta/auditLogs/directoryAudits?$filter=initiatedBy/user/id eq '00000000-0000-0000-0000-000000000000'
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
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/directoryAudits",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET auditLogs/directoryAudits?$select=activityDateTime,activityDisplayName",
"value": [
{
"id": "SSGM_b662f17a-4e4d-4e1c-9248-cdec180024b2_MCDC4_88453290",
"category": "GroupManagement",
"correlationId": "b662f17a-4e4d-4e1c-9248-cdec180024b2",
"result": "success",
"resultReason": "OK",
"activityDisplayName": "GroupLifecyclePolicies_Get",
"activityDateTime": "2024-12-27T10:01:19.5796748Z",
"loggedByService": "Self-service Group Management",
"operationType": "Update",
"userAgent": null,
"initiatedBy": {
"app": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"userPrincipalName": null,
"ipAddress": "10.0.0.0",
"userType": null,
"homeTenantId": null,
"homeTenantName": null
}
},
"targetResources": [
{
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"type": "N/A",
"userPrincipalName": null,
"groupType": null,
"modifiedProperties": []
}
],
"additionalDetails": []
}
]
}