Skip to main content
Use the cdf data upload command to upload data files from your local machine to Cognite Data Fusion (CDF). The command processes structured directories containing data files and their corresponding manifest files. The manifest files define how the data should be uploaded.

Prerequisites

Before uploading data, ensure you have:
  • Installed and configured the Cognite Toolkit.
  • Authenticated with CDF using appropriate credentials.
  • Prepared your data files in the required directory structure.
  • Created manifest files for each data file you want to upload.

Directory structure

The upload command requires a directory containing your data files. Organize the directory using this structure:
When you run the upload command, the Cognite Toolkit performs the following steps:
  1. Searches for all YAML files with the .Manifest.yaml suffix.
  2. For each manifest file, locates the data file with the same prefix.
  3. If --deploy-resources, deploys all resources in the resource directory.
  4. Uploads the data files for each manifest.
The manifest file tells the Cognite Toolkit what kind of data is being uploaded and provides any additional information necessary for the upload. For example, if you are uploading data to CDF RAW, the manifest file specifies which database and table the data should be uploaded to. The format of the manifest file and the supported data types depend on the data you are uploading. Below is a complete list of all supported data types with the expected format of the manifest file for each type. The resources directory contains configurations for resources that must be created before uploading the data. For example, in the case of RAW data, this can be table definitions. If you set the --deploy-resources flag when running the upload command, the Cognite Toolkit creates these resources before uploading the data.
When you download a resource, the Cognite Toolkit automatically places the downloaded files in your selected directory with the specified format.

Upload data

1

Confirm your directory layout

Use the layout in Directory structure: manifest files with the .Manifest.yaml suffix, data files whose names share the same prefix as the manifest, and optional resources/ when definitions must exist before upload (for example RAW table metadata).
2

Run the upload command

From a terminal, run cdf data upload dir with the path to the directory that contains your manifests and data files:
Replace path/to/input_dir with your directory. --cdf-project must match the project in your credentials. If you omit the flag, the command prompts you to type the project name. Pass --overwrite to replace existing data when the data type supports it. For flags and arguments, run cdf data upload dir --help.
3

Deploy related resources (optional)

If you use a resources/ folder, pass --deploy-resources so the Cognite Toolkit creates or updates those resources before uploading the data files:
4

Verify the upload

Confirm that the command finishes without errors. In Cognite Data Fusion, open the relevant experience for your data type (for example RAW explorer for rows in CDF RAW, or Search for assets and time series) and confirm that the data appears as expected.

Assets

Kind: Assets Supported data file formats: .ndjson, .csv, .parquet API endpoint: /assets You can upload assets from a record (.ndjson) or tabular (.csv, .parquet) format. The manifest file for assets can specify a data set or a hierarchy:
myDataSet.Manifest.yaml
myHierarchy.Manifest.yaml
The data file for records looks like this:
myHierarchy-part-0001.Assets.ndjson
Or for tabular formats:
myDataSet.Assets.csv
All assets in the data file must have depth defined when uploading an asset hierarchy. The Cognite Toolkit uses this to ensure that parents are created before their children.

Canvas

Kind: IndustrialCanvas Supported data file format: .ndjson API endpoint: No public API You can upload canvases using a record (.ndjson) format. The manifest file specifies the external IDs of the canvases to upload:
myCanvases.Manifest.yaml
The data file for records looks like this:
myCanvases-part-0001.IndustrialCanvas.ndjson
You usually download canvases with the cdf data download canvas command, for example to copy canvases between CDF projects.

Charts

Kind: Charts Supported data file format: .ndjson API endpoint: No public API You can upload charts using a record (.ndjson) format. The manifest file specifies the external IDs of the charts to upload:
myCharts.Manifest.yaml
The data file for records looks like this:
myCharts-part-0001.Charts.ndjson
Charts are typically downloaded using the cdf data download charts command.

Datapoints

Kind: Datapoints Supported data file formats: .csv, .parquet API endpoint: /timeseries/data You can upload datapoints using tabular (.csv, .parquet) formats. The manifest type determines the layout of the data file: Use datapointsInstanceSpace for state time series. To upload status codes, use one of the row-per-datapoint (long) formats. From Cognite Toolkit v0.9.112, for all types, the Cognite Toolkit:
  • Reads timestamps without a time zone as UTC.
  • Skips values it can’t convert, and logs the number of skipped values.
  • Skips datapoints for time series that don’t exist in CDF instead of failing the whole upload.

Datapoints file (wide format)

With type: datapointsFile, each column holds the values of one time series. The manifest file specifies the mapping between the columns in the data file and the time series identifiers. The identifiers can be either internal IDs, external IDs, instance IDs, or a mix of these. In addition, you need to specify the column containing the timestamps:
myDatapoints.Manifest.yaml
The data file for tabular formats looks like this:
myDatapoints.Datapoints.csv
An empty cell means that the time series has no datapoint at that timestamp, and the Cognite Toolkit uploads nothing for it. The Cognite Toolkit skips rows without a valid timestamp and values in columns that aren’t in the manifest, and logs the number of skipped values. Values in string time series columns are kept as strings. The wide format doesn’t support status codes or state time series.

Datapoints from a data set (long format)

With type: datapointsDataSet, each row holds one datapoint, and the externalId column identifies the time series. Use this format to upload status codes, for example to mark a datapoint as bad. The manifest file specifies the data type of the time series:
myDatapoints.Manifest.yaml
The data set selects the time series that cdf data download datapoints downloads. On upload, the Cognite Toolkit writes to the time series in the externalId column, even if that time series isn’t in the data set. The data file must have exactly the columns externalId, timestamp, and value, and optionally statusCode. The upload fails if the file has other columns:
myDatapoints.Datapoints.csv

Datapoints from an instance space (long format)

Requires Cognite Toolkit v0.9.112 or later and alpha flag extend-download enabled With type: datapointsInstanceSpace, each row holds one datapoint for a CogniteTimeSeries, and the space and externalId columns identify the time series. This is the only format that uploads state time series.
myDatapoints.Manifest.yaml
The instance space selects the time series that cdf data download datapoints downloads. On upload, the Cognite Toolkit writes to the time series in the space and externalId columns of each row, even if that space is a different instance space. The required columns depend on the data type: The data file must have exactly the required columns, and optionally statusCode. The upload fails if the file has other columns. For state time series, each row needs a value in numericValue, stringValue, or both, unless the status code is Bad. numericValue must be a 32-bit integer:
myStateDatapoints.Datapoints.csv
If the extend-download alpha flag isn’t enabled, the Cognite Toolkit skips manifests with type: datapointsInstanceSpace and shows a warning.

Status codes

In the datapointsDataSet and datapointsInstanceSpace formats, the optional statusCode column holds the status code of each datapoint as a decimal number, for example 2147483648 for Bad. Leave the cell empty for datapoints with status Good. A datapoint can be without a value only if its status code is Bad. The Cognite Toolkit skips rows that have neither a value nor a status code, and logs the number of skipped rows.

Create long-format files with the download command

You usually create datapointsDataSet and datapointsInstanceSpace files with the cdf data download datapoints command, which writes the data files and the manifest. To download from an instance space, use --instance-space and --data-type, for example --data-type state --instance-space my_instance_space. See Download data using the Data plugin. A downloaded manifest can include start and end, which limit the time range of the download. The upload ignores them.

Events

Kind: Events Supported data file formats: .ndjson, .csv, .parquet API endpoint: /events You can upload events using record (.ndjson) and tabular (.csv) formats. The manifest file specifies the target data set or the root asset for the event hierarchy:
myDataSet.Manifest.yaml
myHierarchy.Manifest.yaml
The data file for records looks like this:
myEvents-part-0001.Events.ndjson
Or for tabular formats:
myEvents.Events.csv

Files

Kind: FileContent Supported data file format: Any format for the file content itself API endpoint: /files

FileMetadata with content

Requires Cognite Toolkit v0.8.10 or later. Versions before 0.9 also require the extend-upload alpha flag. Supported metadata file format: .ndjson, .csv, .parquet You can upload FileMetadata (asset-centric files) in either record (.ndjson) or tabular (.csv, .parquet) formats.
If your Cognite Toolkit version is older than 0.8.10, use the legacy manifest format with fileMetadataTemplate instead.

Template manifest file

myFileMetadata.Manifest.yaml
This assumes that you have files in the specified fileDirectory:
It will upload each file using the template defined in the manifest file, replacing $FILENAME with the actual file name. For example, file1.txt will be uploaded with:
file1.FileMetadata.yaml

FileMetadata IDs manifest file

You can also upload files using a manifest file that instructs the Cognite Toolkit to simply read the files from CSV, Parquet, or NDJSON files.
myFileMetadata.Manifest.yaml
This assumes that you have an adjacent file with the same prefix and a supported format (CSV, Parquet, or NDJSON) that contains the file metadata, including the file IDs of the files to upload. For example, if you have myFileMetadata.Manifest.yaml, you can have myFileMetadata.csv with the following content:
myFileMetadata.csv
In this case, the file paths in the $FILEPATH column are relative to the location of the manifest file. Combined with this layout, the directory is expected to look like this:

Cognite File with content

Requires Cognite Toolkit v0.8.34 or later. Versions before 0.9 also require the extend-upload alpha flag. Supported metadata file format: .ndjson, .csv, .parquet You can upload Cognite Files (instances in the data model) in either record (.ndjson) or tabular (.csv, .parquet) formats.
If your Cognite Toolkit version is older than 0.8.34, use the legacy manifest format with fileDataModelingTemplate to upload Cognite File instances with content.

Template manifest file

myCogniteFile.Manifest.yaml
This assumes that you have files in the specified fileDirectory:
This will upload each file as a Cognite File instance using the template defined in the manifest file, replacing $FILENAME with the actual file name. For example, file1.txt will be uploaded with:
file1.CogniteFile.yaml

Cognite File IDs manifest file

You can also upload files using a manifest file that instructs the Cognite Toolkit to simply read the files from CSV, Parquet, or NDJSON files.
myCogniteFile.Manifest.yaml
This assumes that you have an adjacent file with the same prefix and a supported format (CSV, Parquet, or NDJSON) that contains the file metadata, including the file IDs of the files to upload. For example, if you have myCogniteFile.Manifest.yaml, you can have myCogniteFile.csv with the following content:
myCogniteFile.csv
In this case, the file paths in the $FILEPATH column are relative to the location of the manifest file. Combined with this layout, the directory is expected to look like this:

Legacy format for manifest file with content

Cognite Toolkit 0.9 and later reject manifests with type: fileMetadataTemplate or type: fileDataModelingTemplate. Use FileMetadata with content or Cognite File with content.
Use these manifest formats if you run a Cognite Toolkit version before 0.9 that does not support the FileMetadataContent or CogniteFileContent kinds documented above. Requires alpha flag extend-upload to be enabled Supported metadata file format: .ndjson

Template for manifest file

You can upload files with content using a template format for the manifest file. Classic template format:
myFileMetadata.Manifest.yaml
Or Data Modeling template format:
myFileMetadata.Manifest.yaml
For example, if you have the following files in the specified fileDirectory:
Then, each file will be uploaded using the template defined in the manifest file, replacing $FILENAME with the actual file name.

Records

Kind: Records Supported data file format: .ndjson From Cognite Toolkit version 0.9, upload records with a manifest of type: recordContainer. The manifest names the stream and the record container.
myRecords.Manifest.yaml

Instances

Kind: Instances Supported data file formats: .ndjson, .csv, .parquet API endpoint: /models/instances You can upload instances using the record (.ndjson) format. The manifest file specifies the instance space for the instances:
myInstances.Manifest.yaml
The data file for records:
myInstances-part-0001.Instances.ndjson
The data file for CSV
myInstances.Instances.csv

Guided upload from a CSV or Parquet file

Requires the extend-upload alpha flag. Use cdf data upload instances to upload a CSV or Parquet file as instances to a view without writing the manifest file yourself:
If you omit the file path, the command prompts you for it. The command then:
  1. Prompts you to select the view to upload the instances to, and whether the file contains nodes or edges.
  2. Checks that the file has the required columns. Nodes require space and externalId. Edges also require type.space, type.externalId, startNode.space, startNode.externalId, endNode.space, and endNode.externalId.
  3. Shows how each column maps to an instance field or a view property. If a column isn’t a property in the view, the command warns you that the upload fails unless you rename or remove the column, and asks whether to create the manifest anyway.
  4. Writes the manifest file next to the data file, named <file name without extension>.Manifest.yaml. If the manifest file already exists, the command asks before it overwrites it.
  5. Asks whether to upload the file now, do a dry run, or only keep the manifest file. To upload the file later, run cdf data upload dir on the folder with the file.
For a file named my_assets.csv uploaded as nodes to the CogniteAsset view, the command creates this manifest:
my_assets.Manifest.yaml
cdf data upload dir uses a manifest file for every data file whose name starts with the same prefix. If other files in the folder share the prefix, the command warns you.

Raw

Kind: RawRows Supported data file formats: .ndjson, .csv, .parquet API endpoint: /raw/dbs//tables//rows You can upload rows to CDF RAW using the record (.ndjson) and tabular (.csv, .parquet) formats. The manifest file specifies the database and table the data should be uploaded to. In addition, for table formats, you can specify the column that should be used as the unique row identifier. If not specified, CDF automatically generates row IDs.
myRawData.Manifest.yaml
The data file for records:
myRawData-part-0001.RawRows.ndjson
Or for tabular formats:
myRawData.RawRows.csv

Use case: Upload metadata to CDF RAW

The Cognite Toolkit manages resource configurations, which are typically metadata rather than data. For example, a sensor’s name, location, type, and attached asset are metadata, while the sensor readings are data. Metadata is often available from a source system. You can use an extraction pipeline to extract and ingest the metadata into CDF. If the metadata isn’t available from a source system, you can store it in CSV files and version-control the files in a Git repository. Use the data plugin to upload the metadata to CDF RAW tables, then use transformations to write the metadata to the correct destination resources. This approach lets you track metadata changes and use the Git repository as the single source of truth. In a CI/CD pipeline, add an upload step after you build and deploy the configurations:
1

Build

Build the configurations with cdf build.
2

Deploy configuration resources

Deploy the resources with cdf deploy.
3

Upload metadata to CDF RAW

Upload the metadata:
Pass --cdf-project so the command doesn’t prompt for the project name and stop the pipeline.
The path/to/raw_metadata directory contains the manifest file and the data file for each RAW table. Set key in each manifest file. Without a key column, CDF generates new row IDs on every upload, and each pipeline run adds another copy of the rows. If the RAW databases and tables are defined in a resources/ folder next to the data files, you can skip the separate cdf deploy step for them and pass --deploy-resources to cdf data upload dir instead. For more information, see Upload data. cdf deploy and cdf data upload behave differently:
  • cdf deploy compares the local resource definitions to the resources in CDF. It creates new resources, updates changed resources, and leaves unchanged resources as they are.
  • cdf data upload writes all rows in the data files on every run. Rows with a key that already exists in the table are replaced. Rows in the table that aren’t in the data files remain. The command is built to handle large amounts of data efficiently.

Time series

Kind: TimeSeries Supported data file formats: .ndjson, .csv, .parquet API endpoint: /timeseries You can upload time series definitions using the record (.ndjson) and tabular (.csv) formats. The manifest file specifies the target data set or the root asset for the hierarchy the time series is connected to:
myDataSet.Manifest.yaml
myHierarchy.Manifest.yaml
The data file for records looks like this:
myTimeSeries-part-0001.TimeSeries.ndjson
Or for tabular formats:
myTimeSeries.TimeSeries.csv

Further reading

Last modified on December 3, 2026