> ## Documentation Index
> Fetch the complete documentation index at: https://developer.onetrust.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Purpose from Data Subjects

Use this API for large scale deletion of a specific purpose from all data subjects.

> 🗒 Things to Know
> 
> - A data subject exclusion list is required to provide the specific data subjects from which the purpose should not be deleted. The **Consent DS Exclusion** import template within Global Settings in the OneTrust Platform can be used to create the data subject exclusion list and can be imported via Bulk Import in the application or via API.
> - Once the data subject exclusion list has been successfully imported, either an `importID` or `jobGuid` parameter value must be specified in the request body.
> - Data subject exclusion lists are valid during the next 30 days after submission.
> - To override the data subject exclusion list requirement, set the `deletePurposeFromAllDataSubjects` parameter value to `true`. By default, this parameter is set to `false`.
> - By default, related data subject transactions will be removed from the database and will no longer appear in the OneTrust Platform UI after calling this API. However, the transactions can still be retrieved using the [Get List of Receipts API](https://developer.onetrust.com/onetrust/reference/getreceiptlistdetailsusingpost). To maintain data subject transactions in the database and OneTrust Platform UI, set the `retainTransactions` parameter to `true`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Consent & Preferences - Universal Consent & Preference Management (OAS)",
    "version": "1.0",
    "contact": {
      "name": "OneTrust Support",
      "url": "https://my.onetrust.com/s/contactsupport"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "description": "The Universal Consent & Preference Management APIs are used to integrate external systems and streamline the flow of data with Universal Consent & Preference Management in the OneTrust Platform."
  },
  "servers": [
    {
      "url": "https://{hostname}",
      "variables": {
        "hostname": {
          "default": "hostname",
          "description": "The OneTrust hostname such as app.onetrust.com, app-eu.onetrust.com, app-de.onetrust.com, app-uk.onetrust.com, app-apac.onetrust.com, trial.onetrust.com, or uat.onetrust.com."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Data Subjects V2",
      "description": "The Data Subjects V2 APIs are used to manage data subjects using version 2 of the API.",
      "externalDocs": {
        "description": "OpenAPI 3.1.0 - Download Definition",
        "url": "https://developer.onetrust.com/onetrust/openapi/consent-preferences-universal-consent-preference-management-oas.json"
      },
      "x-displayName": "Data Subjects V2"
    }
  ],
  "paths": {
    "/api/consent/v2/datasubject-purposes/{purposeGuid}": {
      "delete": {
        "operationId": "deletePurposeFromDataSubjectUsingDELETE",
        "summary": "Delete Purpose from Data Subjects",
        "description": "Use this API for large scale deletion of a specific purpose from all data subjects.\n\n> 🗒 Things to Know\n> \n> - A data subject exclusion list is required to provide the specific data subjects from which the purpose should not be deleted. The **Consent DS Exclusion** import template within Global Settings in the OneTrust Platform can be used to create the data subject exclusion list and can be imported via Bulk Import in the application or via API.\n> - Once the data subject exclusion list has been successfully imported, either an `importID` or `jobGuid` parameter value must be specified in the request body.\n> - Data subject exclusion lists are valid during the next 30 days after submission.\n> - To override the data subject exclusion list requirement, set the `deletePurposeFromAllDataSubjects` parameter value to `true`. By default, this parameter is set to `false`.\n> - By default, related data subject transactions will be removed from the database and will no longer appear in the OneTrust Platform UI after calling this API. However, the transactions can still be retrieved using the [Get List of Receipts API](https://developer.onetrust.com/onetrust/reference/getreceiptlistdetailsusingpost). To maintain data subject transactions in the database and OneTrust Platform UI, set the `retainTransactions` parameter to `true`.",
        "tags": [
          "Data Subjects V2"
        ],
        "x-onetrust": {
          "spec-label": "https://developer.onetrust.com/onetrust/openapi/consent-preferences-universal-consent-preference-management-oas.json"
        },
        "parameters": [
          {
            "name": "purposeGuid",
            "in": "path",
            "description": "UUID of the Purpose to be deleted",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "fb1e4567-e89b-12d3-a456-426614174015"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentAPI_DeleteDataSubjectByPurposeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Purpose deletion from Data Subjects request processed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "DataSubject Profile Delete Request has been accepted"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "429": {
            "description": "Too Many Requests. \nFor more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "description": "The number of seconds after which requests will be allowed again.",
                  "format": "int32"
                }
              },
              "ot-period": {
                "schema": {
                  "description": "The unit of time for which the rate limit applies",
                  "enum": [
                    "HOUR",
                    "MINUTE"
                  ]
                }
              },
              "ot-ratelimit-event-id": {
                "schema": {
                  "description": "The unique identifier for the rate-limiting event.",
                  "format": "uuid"
                }
              },
              "ot-request-made": {
                "schema": {
                  "description": "The number of requests made within the specified period.",
                  "format": "int32"
                }
              },
              "ot-requests-allowed": {
                "schema": {
                  "description": "The number of requests allowed within the specified period.",
                  "format": "int32"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ConsentAPI_OAUTH2": [
              "CONSENT"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ConsentAPI_DeleteDataSubjectByPurposeRequest": {
        "type": "object",
        "properties": {
          "jobGuid": {
            "description": "The UUID of the data exclusion job.",
            "type": "string",
            "format": "uuid",
            "example": "fa0e8400-e29b-41d4-a716-446655441200"
          },
          "importId": {
            "description": "The import ID of the data exclusion job.",
            "type": "string",
            "example": "101"
          },
          "retainTransactions": {
            "description": "This flag indicates whether transactions will be retained while deleting purposes from data subjects. When set to `false`, transactions are removed from the database and no longer appear in the OneTrust Platform UI. However, these transactions are not permanently deleted and can still be retrieved using the [Get List of Receipts API](https://developer.onetrust.com/onetrust/reference/getreceiptlistdetailsusingpost).",
            "type": "boolean",
            "example": false,
            "default": "false"
          },
          "deletePurposeFromAllDataSubjects": {
            "description": "This flag indicates whether the purpose should be deleted from all data subjects.",
            "type": "boolean",
            "example": false,
            "default": "false"
          }
        }
      }
    },
    "securitySchemes": {
      "ConsentAPI_OAUTH2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://{hostname}/api/access/v1/oauth/token",
            "scopes": {
              "CONSENT": "Consent Scope gives the user access to read/write operations",
              "CONSENT_READ": "Consent Read Scope gives the user read-only access"
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "metrics-enabled": false
  },
  "x-onetrust": {
    "spec-label": "OpenAPI 3.1.0"
  }
}
```