Register a purge contacts API task

Version:

You can use the xConnect Web API to remove unwanted data from your contacts. To do this, you must register a purge task.

To register a task:

  • Use the following API:

    <instance>/sitecore/api/datatools/purge/tasks/contacts

    The successful task registration request returns the task ID used for status monitoring, for example:

    {
        "TaskId": "049cd8b3-b120-4949-a42f-cdc2fe4f3086"
    }

Parameters

The following describes the POST parameters that you can send to the Web API to register a purge task:

ParameterOptionalDefaultTypeDescription
BatchSizeYes100IntegerThe data extraction batch size of contacts.

The BatchSize system parameter controls the amount of data extracted from the collection database for each cursor read.
Important

Use a small batch size for the purging process to not overload the system too much, and so it can cancel tasks with less impact. Task cancellation is not an immediate process and does not cancel an ongoing batch.

DefaultSplitItemCountYes100IntegerContact data extraction cursor split count.

The DefaultSplitItemCount system parameter controls the split process of contact data extraction.
ExpiresAfterHoursYes24IntegerThe expiration of the task in the final state.

The final task status is either successful or failed and removed from the system after the expiration period.
CutoffDaysNo-Nullable IntegerThe last contact activity must be greater or equal to the specified amount of days. The range restriction is 0 to the int.MaxValue.

The CutoffDays parameter specifies the number of days the contact is not interacting with the brand.

The data extraction process uses this parameter to filter contacts based on the LastModified value. The LastModified date-time reflects the last interaction of the contact.
StartPercentileYesNullNullable DoubleThe start sampling range value. The range restriction is 0 to 1.

The percentile range specifies the subset of data to extract. Use this parameter to perform the purging in small batches to avoid stressing the system too much.

The data extraction process filters contacts based on the percentile range and the CutOffDays parameter.
EndPercentileYesNullNullable DoubleThe end sampling range value. The range restriction is 0 to 1.

The percentile range specifies the subset of data to extract. Use this parameter to perform the purging in small batches to avoid stressing the system too much.

The data extraction process filters contacts based on the percentile range and the CutOffDays parameter.
ConditionsYes""StringList of condition names. Multiple conditions run with the AND logical operator.

The Conditions parameters let you specify custom condition keys used to identify contacts for purging. You must register custom conditions in the Cortex Processing Engine.

You delimit Conditions IDs with a comma.

The total length of the parameter must be less than 2019 characters.

The filtering with conditions is performed in-memory, not at the database level. If the contact passes all the conditions, then the purging tool can purge the contact.
If you have suggestions for improving this article, let us know!