# startPersonalDataRetrievalTask

Version 2024-11-01

> 📘 Important
>
> The Buy with Prime API is offered as a preview and might change as we receive feedback and iterate on the interfaces. We are sharing this early documentation to help you learn about the Buy with Prime API as we write and iterate on the content.

## Overview

<p>Starts a personal data retrieval task.</p>

> ℹ️ Required scope(s)
> Manage Shopper Privacy Requests

## Response

Return type [StartPersonalDataRetrievalTaskResponse](doc:privacy-objects-startpersonaldataretrievaltaskresponse "StartPersonalDataRetrievalTaskResponse")

## Arguments

<table>
<thead>
<tr>
<th align="left">Argument</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>input</code> (<a href="doc:privacy-objects-startpersonaldataretrievaltaskinput" title="StartPersonalDataRetrievalTaskInput">StartPersonalDataRetrievalTaskInput</a>&nbsp;<sup>required</sup>)</td>
<td align="left"><p>Specifies the input fields to start a personal data retrieval task.</p>
</td>
</tr>
</tbody>
</table>

## Examples

***

### Start Personal Data Retrieval Task

#### Request

```gql
mutation {
    startPersonalDataRetrievalTask(input: {
        dataSubject: {
            type: SHOPPER
            email: "example@email.com"
        }
    }) {
        taskId
    }
}
```

#### Response

```json
{
  "data": {
    "startPersonalDataRetrievalTask": {
      "taskId": "942d40d5-b514-4076-bd6c-c4bc326324bf"
    }
  }
}
```

***

### Email Validation Error

#### Request

```gql
mutation {
    startPersonalDataRetrievalTask(input: {
        dataSubject: {
            type: SHOPPER
            email: "aemail.com"
        }
    }) {
        taskId
    }
}
```

#### Response

```json
{
  "errors": [
    {
      "message": "Input request is not valid, the following issues were encountered: [/startPersonalDataRetrievalTask/input/dataSubject/email must match \"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+[.][a-zA-Z]{2,}$\"]",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "startPersonalDataRetrievalTask"
      ],
      "extensions": {
        "classification": {
          "type": "ValidationError",
          "code": "UnspecifiedError",
          "details": {
            "message": "Input request is not valid, the following issues were encountered: [/startPersonalDataRetrievalTask/input/dataSubject/email must match \"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+[.][a-zA-Z]{2,}$\"]"
          },
          "errorType": "ValidationException",
          "errorCode": 400
        }
      }
    }
  ],
  "data": {
    "startPersonalDataRetrievalTask": null
  }
}
```

***

### Email Not Provided Error

#### Request

```gql
mutation {
    startPersonalDataRetrievalTask(input: {
        dataSubject: {
            type: SHOPPER
        }
    }) {
        taskId
    }
}
```

#### Response

```json
{
  "errors": [
    {
      "message": "The dataSubject must have an email specified to initiate a personalDataRetrievalTask.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "startPersonalDataRetrievalTask"
      ],
      "extensions": {
        "classification": {
          "type": "ValidationError",
          "code": "EmailNotProvidedForPersonalDataRetrievalTask",
          "details": {
            "message": "The dataSubject must have an email specified to initiate a personalDataRetrievalTask."
          },
          "errorType": "ValidationException",
          "errorCode": 400
        }
      }
    }
  ],
  "data": {
    "startPersonalDataRetrievalTask": null
  }
}
```

***