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>
By default, this command will not delete nodes that are time series or files. This is to prevent accidentally losing datapoints and file content. To delete these nodes as well, use the --delete-datapoints and --delete-file-content flags.

Purge instances

To delete instances, use the instances subcommand.
This command is used to unlink nodes that are time series or files. This means that the nodes were created with the migration plugin and have linked classical time series and files to them. Unlinking allows you to reverse this operation, by first removing the link between the node and the time series/file, and then deleting the node. Thus, the classical time series/file will remain in CDF after the purge operation including the datapoints and file content. Note that this is only the case for nodes that were created with the migration plugin.
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 --list <path-to-csv-file>
The CSV file should have three columns: space, externalId, and instanceType. For example:
to-delete.csv
space,externalId,instanceType
my-space,node1,node
my-space,node2,node
my-other-space,edge1,edge
my-other-space,edge2,edge
The space column specifies the space the instance belongs to, the externalId column specifies the instance’s external ID, and the instanceType column specifies whether the instance is a node or an edge.

Further reading

Last modified on January 29, 2026