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.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) User.Export.All
Delegated (personal Microsoft account) Not applicable
Application User.Export.All

Note: The export can only be performed by a company administrator when delegated permissions are used.

HTTP request

POST /users/{id}/exportPersonalData

Request headers

Name Description
Authorization Bearer {token}

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 does not return anything in the response body. The response contains the following response 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/v1.0/users/{id}/exportPersonalData
Content-type: application/json

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