Get package SAS URI API
Applies to:
Want to experience Microsoft Defender for Endpoint? Sign up for a free trial.
Note
If you are a US Government customer, please use the URIs listed in Microsoft Defender for Endpoint for US Government customers.
Tip
For better performance, you can use server closer to your geo location:
- us.api.security.microsoft.com
- eu.api.security.microsoft.com
- uk.api.security.microsoft.com
- au.api.security.microsoft.com
- swa.api.security.microsoft.com
- ina.api.security.microsoft.com
API description
Get a URI that allows downloading of an Investigation package.
Important
- These actions are only available for devices on Windows 10, version 1703 or later, and on Windows 11.
Limitations
Rate limitations for this API are 2 calls per minute and 120 calls per hour.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Access the Microsoft Defender for Endpoint APIs
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.CollectForensics | 'Collect forensics' |
Note
When obtaining a token using user credentials:
- The user needs to have at least the following role permission: 'Alerts Investigation' (For more information, see Create and manage roles)
- The user needs to have access to the device, 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
GET https://api.security.microsoft.com/api/machineactions/{machine action id}/getPackageUri
Request headers
Name | Type | Description |
---|---|---|
Authorization | String | Bearer {token}. Required. |
Request body
Empty
Response
If successful, this method returns 200, Ok response code with object that holds the link to the package in the "value" parameter. This link is valid for a short time and should be used immediately for downloading the package to a local storage. If the machine action for the collection exists but isn't complete, this returns 404 Not Found.
Example
Request example
Here's an example of the request.
GET https://api.security.microsoft.com/api/machineactions/7327b54fd718525cbca07dacde913b5ac3c85673/GetPackageUri
Response example
Here's an example of the response.
HTTP/1.1 200 Ok
Content-type: application/json
{
"@odata.context": "https://api.security.microsoft.com/api/$metadata#Edm.String",
"value": "\"https://userrequests-us.securitycenter.windows.com:443/safedownload/WDATP_Investigation_Package.zip?token=gbDyj7y%2fbWGAZjn2sFiZXlliBTXOCVG7yiJ6mXNaQ9pLByC2W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ZwbSwescs0IpzECitBbaLUz4aT8KTs8T0lvx8D7Te3wVsKAJ1r3iFMQZrlk%2bS1WW8rvac7oHRx2HKURn1v7fDIQWgJr9aNsNlFz4fLJ50T2qSHuuepkLVbe93Va072aMGhvr09WVKoTpAf1j2bcFZZU6Za5PxI32mr0k90FgiYFJ1F%2f1vRDrGwvWVWUkR3Z33m4g0gHa52W1FMxQY0TJIwbovD6FaSNDx7xhKZSd5IJ7r6P91Gez49PaZRcAZPjd%2bfbul3JNm1VqQPTLohT7wa0ymRiXpSST74xtFzuEBzNSNATdbngj3%2fwV4JesTjZjIj5Dc%3d%3blumqauVlFuuO8MQffZgs0tLJ4Fq6fpeozPTdDf8Ll6XLegi079%2b4mSPFjTK0y6eohstxdoOdom2wAHiZwk0u4KLKmRkfYOdT1wHY79qKoBQ3ZDHFTys9V%2fcwKGl%2bl8IenWDutHygn5IcA1y7GTZj4g%3d%3d\""
}
Tip
Do you want to learn more? Engage with the Microsoft Security community in our Tech Community: Microsoft Defender for Endpoint Tech Community.