startPersonalDataDeletionTask

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

Starts a personal data deletion task.

ℹī¸

Required scope(s)

Manage Shopper Privacy Requests

Response

Return type StartPersonalDataDeletionTaskResponse

Arguments

ArgumentDescription
input (StartPersonalDataDeletionTaskInput required)

Specifies the input fields to start a personal data deletion task.

Examples


Start Personal Data Deletion Task

Request

mutation {
    startPersonalDataDeletionTask(input: {
        holdingPeriod: 5
        dataSubject: {
            type: SHOPPER
            email: "[email protected]"
        }
    }) {
        taskId
    }
}

Response

{
  "data": {
    "startPersonalDataDeletionTask": {
      "taskId": "689b9fa5-0f94-44c2-b6e1-75f1ed4472f0"
    }
  }
}

Holding Period Validation Error

Request

mutation {
    startPersonalDataDeletionTask(input: {
        holdingPeriod: 200
        dataSubject: {
            type: SHOPPER
            email: "[email protected]"
        }
    }) {
        taskId
    }
}

Response

{
  "errors": [
    {
      "message": "Input request is not valid, the following issues were encountered: [/startPersonalDataDeletionTask/input/holdingPeriod must be less than or equal to 180]",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "startPersonalDataDeletionTask"
      ],
      "extensions": {
        "classification": {
          "type": "ValidationError",
          "code": "UnspecifiedError",
          "details": {
            "message": "Input request is not valid, the following issues were encountered: [/startPersonalDataDeletionTask/input/holdingPeriod must be less than or equal to 180]"
          },
          "errorType": "ValidationException",
          "errorCode": 400
        }
      }
    }
  ],
  "data": {
    "startPersonalDataDeletionTask": null
  }
}

Email Validation Error

Request

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

Response

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

Email Not Provided Error

Request

mutation {
    startPersonalDataDeletionTask(input: {
        dataSubject: {
            type: SHOPPER
        }
    }) {
        taskId
    }
}

Response

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