user: exportPersonalData

Namespace: microsoft.graph

Submit a data policy operation request from a company administrator or an application to export an organizational user's data. This data includes the user's data stored in OneDrive and their activity reports. For more guidance about exporting data while complying with regulations, see Data Subject Requests and the GDPR and CCPA.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) User.Export.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application User.Export.All Not available.

Note: Export can only be performed by a company administrator when the delegated permission is used.

HTTP request

POST /users/{id}/exportPersonalData

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
storageLocation String This is a shared access signature (SAS) URL to an Azure Storage account, to where data should be exported.

Response

If successful, this method returns a 202 Accepted response code. It doesn't return anything in the response body. The response contains the following headers.

Name Description
Location URL to check on the status of the Request.
Retry-After Time period in seconds. Request maker should wait this long after submitting a request to check for the status.

Example

Request
POST https://graph.microsoft.com/beta/users/{id}/exportPersonalData
Content-type: application/json

{
  "storageLocation": "storageLocation-value"
}
Response
{
  Location: https://graph.microsoft.com/beta/dataPolicyOperations/d007e3da-cd9b-4b02-8d66-422403c53e3f
  Retry-After: 60
}
HTTP/1.1 202 Accepted