Get scan agent ID

Applies to:

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

Want to experience Microsoft Defender Vulnerability Management? Find out how to sign up for a free trial.


Some information in this article relates to prereleased product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.


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 the details for a specified agent by its ID.


  1. Rate limitations for this API are 100 calls per minute and 1500 calls per hour.


One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Use Microsoft Defender for Endpoint APIs.

Permission type Permission Permission display name
Application Machine.Read.All Read all scan information.
Delegated (work or school account) Machine.Read.All Read all scan information.


When obtaining a token using user credentials:

  • To view data the user needs to have at least the following role permission: 'ViewData' or 'TvmViewData' (See Create and manage roles for more information)

HTTP request

GET /api/DeviceAuthenticatedScanAgents

Request headers

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

Request body



If successful, this method returns 200 - OK response code with the details of the specified agent.

Example request

Here's an example of the request.


Response example

"@odata.context": "$metadata#DeviceAuthenticatedScanAgents/$entity",
    "value": [
    "id": "47df41a0c-asad-4fd6d3-bbea-a93dbc0bfcaa_4edd75b2407a5b64d704b4e53d74f15",
    "machineId": "4ejh675b240118fbehiuiy5b64d704b4e53d15",
    "lastSeen": "2022-05-08T12:18:41.538203Z",
    "computerDnsName": "TEST_DOMAIN",
    "AssignedApplicationId": "9E0FA0EB-0A51-4357-9C87-C21BFBE07571",
    "ScannerSoftwareVersion": "7.1.1",
    "LastCommandExecutionTimestamp": "2022-05-08T12:18:41.538203Z",
    "mdeClientVersion": "10.8295.22621.1195"


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