Unify and manage your data

Bulk Delete Entities

Learn how to use the Bulk Delete Entities task to remove multiple profiles from a tenant by using filters or entity URIs.

The Bulk Delete Entities task uses the Delete entities by entity type task to remove entities based on a specified filter or list of entity URIs.

The Bulk Delete Entities task executes a search request to identify the target entities and deletes them by iterating over the results. This task supports distributed mode, which allows it to run in parallel across multiple API nodes for greater scalability. This approach is recommended for large-scale or tenant-wide deletions.

Before you run the Bulk Delete Entities task, run the Cassandra ES Consistency task to ensure that the Elasticsearch storage is in a consistent state with the main data storage. For more information, see Delete Entities Task and Cassandra ES Consistency Task.

This operation on the Developer portal is here.

HTTP method and endpoint

Use the following HTTP method and endpoint path to submit the request to delete entities that match the specified filter or entity URI list.

POST {TenantURL}/entities/_delete

Query parameters

The following table describes the query parameters and their values. A query parameter is a key-value pair added to the end of a URL to modify or refine a request.

ParameterTypeRequiredDescriptionAccepted values / Default
modeStringNoSpecifies how entities are removed.soft or hard. soft marks the entity as deleted but keeps all data in storage. hard retains entity data such as entity ID, version, and date fields, and removes other data such as crosswalks and attributes from storage. Default: not specified in source.
Note: Entities that only have the soft parameter mode enabled are also removed.
sendMailBooleanNoSpecifies whether an email is sent after the task is completed.If not specified, an email is not sent.
distributedBooleanNoSpecifies whether the task is distributed or not. For more information, see Distributed mode.true or false. Default: false.
taskPartsCountIntegerNoSpecifies the maximum number of sub-tasks for distributed execution. The platform determines the optimal number based on performance limits. Each sub-task processes a separate subset of objects and can run in parallel on different API nodes.Applicable only when distributed=true. If not specified and distributed is true, default: 4. Otherwise, ignored.

Request headers

The following request headers must be included.

HeaderValueRequired
AuthorizationBearer <accessToken>Yes

For more information, see Authentication API.

Request body

The following table describes the request body parameters, including accepted values and defaults.

ParameterTypeRequiredDescriptionAccepted values / Default
objectsObjectYesContainer for the delete request parameters.JSON object.
filterStringNoSearch filter that identifies the entities to delete.Search filter expression.
listArrayNoList of entity URIs to delete. If you specify entity URIs, the task processes only those entities.JSON array of entity URIs.
excludeListArrayNoList of entity URIs to exclude from deletion when a filter is used.JSON array of entity URIs.
optionsObjectNoAdditional search options for the request.Search options object.
activenessStringNoActiveness filter for the search request.Activeness value.

Example request

Use the following example to see how a complete request is structured with headers and a JSON body.

POST {TenantURL}/entities/_delete
Headers: Authorization: Bearer {your-access-token}
{
  "objects": {
    "filter": "startsWith(attributes.LastName, 'Ind')",
    "excludeList": [ "entities/i2", "entities/i3" ]
  }
}

Response body

The following table describes the fields returned in the response body.

ParameterTypeDescription
numberOfProcessedObjectsNumberNumber of deleted entities since the task started.
objectsFailedToDeleteCountNumberNumber of objects that were not deleted.
objectsFailedToDeleteArrayEntity IDs that were not deleted. Only 100 entity IDs that were not deleted are displayed.
nameStringName of the manual task in the following format: <Hard/Soft> Delete Entities By Type: <entity type URI>.
startedTimeTime when the task started.
throughputNumberCurrent speed of the task, which is the number of entities deleted per second.
tenantStringName of the tenant.
currentTimeCurrent system time.

Example response

The following example shows a response with the launched task details.

{
  "id": "f3d47316-c249-4e60-9a8a-8e97cc9ca0e3",
  ...
  "parameters": {
    "tenantId": "jondoe",
    "entityType": "HCP",
    "mode": "hard"
  },
  "currentState": {
    "objectsFailedToDelete": [
      "1AlLNjPS",
      "8C06vMB"
    ],
    "entityType": "configuration/entityTypes/HCP",
    "lastExecutionEC2Instances": "i-i-{instance-id}",
    "objectsFailedToDeleteCount": 2,
    "numberOfFailedToPublishEvents": 0,
    "lastHourThroughput": 0.0,
    "numberOfProcessedObjects": 126,
    "status": "Completed"
  },
  "throughput": 9.692307,
  "duration": "13s"
}