Skip to main content
Use the cdf data purge command to delete data from Cognite Data Fusion (CDF). The command has subcommands for deleting different types of data, including data sets, spaces, and instances.
Purging data is a destructive operation that cannot be undone. Always verify what you are deleting before running purge commands.

Prerequisites

Before purging data, ensure you have:
  • Installed and configured the Cognite Toolkit.
  • Authenticated with CDF using appropriate credentials.
  • Admin or delete permissions for the data you want to purge.
  • Backed up any data you might need to restore later.

Purge data sets

To delete all data in a data set, use the dataset subcommand. You can also specify to include all configuration resources in the data set.
cdf data purge dataset <dataset-external-id>

Purge spaces

To delete all data in a space, use the space subcommand. This is typically used to delete a schema space (a space containing data models, views, and containers).
Do not use this command to delete large amounts of data unless you intend to delete everything in the space.
cdf data purge space <space-external-id>

Purge instances

To delete instances, use the instances subcommand. You can select which instances to delete in multiple ways:

Delete by view

Delete all instances that have data in a view:
cdf data purge instances --view <space>:<view-external-id>/<version>

Delete by instance space

Delete all instances in an instance space:
cdf data purge instances --instance-space <space-external-id>

Delete by CSV

Delete instances listed in a CSV file:
cdf data purge instances --file <path-to-csv-file>

Further reading