Unify and manage your data

Bulk Delete Entities

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

The Bulk delete entities task uses the Delete entities by entity type task to remove all 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, allowing 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 this 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 topics Delete Entities Task and Cassandra ES Consistency Task.

Request

POST {TenantURL}/entities/_delete

This operation on the Developer portal is here.

Table 1. Parameters
Parameter Required Details
Headers Authorization Yes Authentication access token in the format "Bearer <accessToken>". For more information, see Authentication API.
Query mode No

Specifies how entities are removed:

  • soft - the entity is marked as deleted but all data remains in the data storage (you cannot see or restore the entity).
  • hard - entity data such as entity ID, version, and date fields are retained and all other data such as crosswalks and attributes are removed from the data storage.
Note: Entities that only have the soft parameter mode enabled are also removed.
sendMail No Specifies if an email must be sent after the task is completed. If the parameter is not specified, an email is not sent.
distributedNoSpecifies whether the task is distributed or not. Default is false.

For more details, see Distributed mode.

taskPartsCountNoSpecifies 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. If not specified and distributed is true, the default value is 4.
Note: This parameter is applicable only when distributed=true. Otherwise, it's ignored.
BodyYes

The JSON object representing the delete entities request object. It must have the objects property that represents the entities in the API request. For more information, see topic Bulk update of attributes.

If you specify the entity URIs, then only these entities are processed.

Response

JSON Object representing information about launched manual task which will delete all entities of the specified type:
  • numberOfProcessedObjects- number of deleted entities since the task started.
  • objectsFailedToDeleteCount- number of objects that were not deleted.
  • objectsFailedToDelete- entity IDs that were not deleted (only 100 entity IDs that were not deleted are displayed).
  • name- name of the manual task in the following format: "<Hard/Soft> Delete Entities By Type: <entity type URI>".
  • started- time when the task started.
  • throughput- current speed of the task (number of entities deleted per second).
  • tenant- name of the tenant.
  • current- current system time.

Examples


      POST {TenantURL}/entities/_delete
Headers: Authorization: Bearer c3f28fdd-e082-4f90-8840-9896914eaf41
{
 "objects" : {
  "filter" : "startsWith(attributes.LastName, 'Ind')",
  "excludeList" : [ "entities/i2", "entities/i3" ]
 }
}
      

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