The CLI purge contacts command

Abstract

Reference of the xConnect DevEx CLI purge contacts start command that registers data purge tasks.

The xConnect DevEx CLI plugin includes a purge command, with a contacts start subcommand. This command initiates a data purge process based on the provided CutoffDays and conditions.

You can use the command as follows:

sitecore purge contacts start [options]

You can use the following options with the command:

Option

Required?

Default

Description

-c, --config

Yes

cwd

The path to the sitecore.json configuration file. A DevEx CLI standard option.

-n, --environment-name

Yes

'default'

The Sitecore environment to use. A DevEx CLI standard option.

-d, --cutoffdays

Yes

The number of days the contact has not interacted with the brand. For example, -d 10.

Note

This option is the only requirement with no default value.

By default, the minimum available value is 180 days (see Configure the Cortex Processing Engine for task registration).

--sp, --start-percentile

No

The start percentile range-bound for the data extraction. For example, --sp 0.

--ep, --end-percentile

No

The end percentile range-bound for data extraction. For example, --ep 1.

--cds, --conditions

No

The comma-separated list of additional conditions to filter contacts to purge. Conditions can be customized and registered for further filtering. For example, --cds AnonymousCondition.

-b, --batch-size

Yes

100

The batch size for contact data extraction the data purge task uses. For example, -b 200.

-v, --verbose

No

Report additional diagnostic and performance data.

-t, --trace

No

Report additional diagnostic and performance data.

--confirm

No

Confirm all prompts automatically.

-?, -h, --help

No

Help for the xconnect purge contacts start command.

Examples of command option use:

sitecore xconnect purge contacts start -d 5

sitecore xconnect purge contacts start -d 10 --sp 0 --ep 1 -b 200 --cds AnonymousCondition --trace --verbose

The contacts start command sends a confirmation to the end-user that this command causes data deletion.

The user can confirm task registration by entering Y or y:

A successful task registration returns a task ID that you can keep for further actions, such as getting the task status or canceling the task.

The user can also cancel the task registration with N or n. Any other character entries lead to the cancellation of the task registration too, with a corresponding notification, that the confirmation response was invalid.

You may use option --confirm for silent confirmation of the task registration. In that case, you do not receive any prompts.

The result of the successful task registration is the task ID and sample commands for canceling and getting the status of the purge task.

There is a list of restrictions for the percentile range options:

  • You must specify both the start and end percentile or none of them.

  • The range-bound for both is between 0 and 1.

  • The end percentile must be higher than the start percentile.

The task registration fails if a non-existing condition is specified. A list of unfound conditions is in the CLI output.

Note

See Walkthrough: Customizing contact purge conditions for more details about limits and how to create custom conditions.