Skip to main content
The Purge API endpoint facilitates the bulk deletion of resources, relationships, or objects from a data source. This operation is ideal for cleanup tasks, ensuring that all data of a specific profile or object definition is completely removed from the target collection.

Using the Purge Endpoint

A purge request specifies exactly what Data Source is the target of the operation, including the type and key of the contained collection to remove all data.
{
    "collectionType": "<type>", // "resources", "relationships", or "objects" based on what is targeted
    "collectionKey": "<key>"
}
To delete all “providers” contained in a collection, the payload would look like:
{
    "collectionType": "resources",
    "collectionKey": "provider"
}
For more details, see Create Purge Operation. The endpoint accepts the same payload when collectionType is set to objects.

Purge Status

Once a purge operation is initiated, the system responds with a unique identifier (purgeId) and details about the operation’s progress:
{
    "purgeId": "<id>", // Id of the purge operation.
    "collectionType": "<type>", // "resources", "relationships", or "objects" based on what is targeted
    "collectionKey": "<key>",
    "status": "<status>", // Status of the purge operation ("SUCCESS", "PENDING" or "FAILURE")
    "deletedCount": 0, // Number of items affected by the purge operation
    "createdAt": "2023-12-12T15:30:10.0000Z",
    "updatedAt": "2023-12-12T15:31:10.0000Z"
}
You can use the purgeId to retrieve the status of an ongoing operation, similar to bulk operation monitoring. When the status is “SUCCESS”, the specified elements have been deleted from the registry, additionally, the system ensures eventual consistency at the partition level. This means that while the data has been purged from the data sources, there may be a delay before the changes propagate across all partitions referring to it.
For more details, refer to Using the Purge Status

Notes

  • Target the Correct Data Source: Ensure the collectionKey accurately identifies the intended collection within the data source to avoid unintentional deletions.
  • Use collectionType to Differentiate Targets:
    • resources: Targets resources like provider or office.
    • relationships: Targets relationships such as provider-office.
    • objects: Targets stored files or media captured in an object collection.
  • Best Practices for Safe Purging:
    • Review all inputs before initiating a purge.
    • Use status monitoring (purgeId) to confirm successful execution or handle errors.
Deletion PropagationThe purge operation uses a cascading effect. If a resource is deleted, all its attached relationships will also be deleted.This is not the case for relationships. Deleting relationships will not affect their referred resources. Deleting objects removes both the binary payload and any pipeline-enriched properties associated with the object.
I