List machines API

Applies to:

Want to experience Microsoft Defender for Endpoint? Sign up for a free trial.


If you are a US Government customer, please use the URIs listed in Microsoft Defender for Endpoint for US Government customers.


For better performance, you can use server closer to your geo location:


API description

Retrieves a collection of Machines that have communicated with Microsoft Defender for Endpoint cloud.

Supports OData V4 queries.

The OData's $filter query is supported on: computerDnsName, id, version, deviceValue, aadDeviceId, machineTags, lastSeen,exposureLevel, onboardingStatus, lastIpAddress, healthStatus, osPlatform, riskScore and rbacGroupId.
$top with max value of 10,000
$skip See examples at OData queries with Defender for Endpoint


  • You can get devices last seen according to your configured retention period.
  • Maximum page size is 10,000.
  • Rate limitations for this API are 100 calls per minute and 1500 calls per hour.


Permission type Permission Permission display name
Application Machine.Read.All 'Read all machine profiles'
Application Machine.ReadWrite.All 'Read and write all machine information'
Delegated (work or school account) Machine.Read 'Read machine information'
Delegated (work or school account) Machine.ReadWrite 'Read and write machine information'


When obtaining a token using user credentials:

  • The user needs to have at least the following role permission: 'View Data' (For more information, see Create and manage roles)
  • Response will include only devices, that the user have access to, based on device group settings (For more information, see Create and manage device groups)

Device group creation is supported in Defender for Endpoint Plan 1 and Plan 2.

HTTP request


Request headers

Name Type Description
Authorization String Bearer {token}. Required.

Request body



If successful and machines exists - 200 OK with list of machine entities in the body. If no recent machines - 404 Not Found.


Request example

Here's an example of the request.


Response example

Here's an example of the response.

HTTP/1.1 200 OK
Content-type: application/json
    "@odata.context": "$metadata#Machines",
    "value": [
            "id": "1e5bc9d7e413ddd7902c2932e418702b84d0cc07",
            "computerDnsName": "",
            "firstSeen": "2018-08-02T14:55:03.7791856Z",
            "lastSeen": "2018-08-02T14:55:03.7791856Z",
            "osPlatform": "Windows10" "Windows11",
            "version": "1709",
            "osProcessor": "x64",
            "lastIpAddress": "",
            "lastExternalIpAddress": "",
            "osBuild": 18209,
            "healthStatus": "Active",
            "rbacGroupId": 140,
            "rbacGroupName": "The-A-Team",
            "riskScore": "Low",
            "exposureLevel": "Medium",
            "isAadJoined": true,
            "aadDeviceId": "80fe8ff8-2624-418e-9591-41f0491218f9",
            "machineTags": [ "test tag 1", "test tag 2" ]


Do you want to learn more? Engage with the Microsoft Security community in our Tech Community: Microsoft Defender for Endpoint Tech Community.