Skip to content

Toolbox: Remove User Classifications

For instances where you are using classifications, you may need to remove the assigned classifications of your known users either in part or in full. This script will help you do so.

Backup of Data

Please keep in mind that Relewise does not keep ready backups of your data on hand. If these scripts override something unintentionally, it cannot be undone. Please make sure that you are completely certain you want to perform this action before you commit to it.

csharp
void Main()
{
	var apiKeySecret = ""; // Needs the "Integration - UserAdministrativeAction" permission
	var datasetId = Guid.Parse("");
	var serverUrl = "";
	
	var tracker = new Tracker(datasetId, apiKeySecret, serverUrl);

	var request = new UserAdministrativeAction(
	 new UserConditionCollection(new EmailCondition(["non-existing-email"], negated: true)), // Targets all users
	
	 new UserAdministrativeAction.RemoveClassifications(["classification-key"]));
	
	 //new UserAdministrativeAction.RemoveClassifications(null));  // Clears ALL classifications

	tracker.Track(request);
}

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com