List files

The GET /files operation can be used to return information for all files in a project.

Optionally you can add one or more of the following query parameters. The filter query parameters will filter the results to only include files that match all filter parameters.

Request throttling

This endpoint is meant for data analytics/exploration usage and is not suitable for high load data retrieval usage. It is a subject of the new throttling schema (limited request rate and concurrency). Please check Files resource description for more information.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 100

Limits the number of results to be returned. The maximum results returned by the server is 1000 even if you specify a higher limit.

cursor
string

Cursor for paging through results.

Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo
name
string (FileName) <= 256 characters

Name of the file.

mimeType
string (MimeType) <= 256 characters

File type. E.g. text/plain, application/pdf, ..

Example: mimeType=image/jpeg
source
string (FileSource) <= 128 characters

The source of the file.

assetIds
Array of integers <int64> (AssetIds) [ 1 .. 100 ] items unique

Only include files that reference these specific asset IDs.

Example: assetIds=363848954441724&assetIds=793045462540095&assetIds=1261042166839739
assetExternalIds
string <jsonArray(string)> (JsonArrayString)

Asset external IDs of related equipment that this file relates to. Takes 1..100 unique items.

Example: assetExternalIds=["externalId1", "externalId2", "externalId3"]
Array of DataSetInternalId (object) or DataSetExternalId (object) (DataSetIdEithers)
rootAssetIds
string <jsonArray(int64)> (JsonArrayInt64)

Only include files that have a related asset in a tree rooted at any of these root assetIds.

Example: rootAssetIds=[363848954441724, 793045462540095, 1261042166839739]
assetSubtreeIds
string <jsonArray(int64)> (JsonArrayInt64)

Only include files that have a related asset in a subtree rooted at any of these assetIds (including the roots given). If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

Example: assetSubtreeIds=[363848954441724, 793045462540095, 1261042166839739]
assetSubtreeExternalIds
string <jsonArray(string)> (JsonArrayString)

Only include files that have a related asset in a subtree rooted at any of these assetExternalIds (including the roots given). If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

Example: assetSubtreeExternalIds=["externalId1", "externalId2", "externalId3"]
minCreatedTime
integer <int64> (EpochTimestamp) >= 0

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

maxCreatedTime
integer <int64> (EpochTimestamp) >= 0

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

minLastUpdatedTime
integer <int64> (EpochTimestamp) >= 0

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

maxLastUpdatedTime
integer <int64> (EpochTimestamp) >= 0

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

minUploadedTime
integer <int64> (EpochTimestamp) >= 0

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

maxUploadedTime
integer <int64> (EpochTimestamp) >= 0

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

minSourceCreatedTime
integer <int64> (EpochTimestamp) >= 0

Include files that have sourceCreatedTime set and with minimum this value.

maxSourceCreatedTime
integer <int64> (EpochTimestamp) >= 0

Include files that have sourceCreatedTime set and with maximum this value.

minSourceModifiedTime
integer <int64> (EpochTimestamp) >= 0

Include files that have sourceModifiedTime set and with minimum this value.

maxSourceModifiedTime
integer <int64> (EpochTimestamp) >= 0

Include files that have sourceModifiedTime set and with maximum this value.

externalIdPrefix
string (CogniteExternalIdPrefix) <= 255 characters

Filter by this (case-sensitive) prefix for the external ID.

Example: externalIdPrefix=my.known.prefix
uploaded
boolean

Whether or not the actual file is uploaded. This field is returned only by the API, it has no effect in a post body.

Example: uploaded=true
partition
string

Splits the data set into N partitions. The attribute is specified as a "M/N" string, where M is a natural number in the interval of [1, N]. You need to follow the cursors within each partition in order to receive all the data.

The maximum number of allowed partitions (N) is 10.

Cognite rejects requests if you specify more than 10 partitions. When Cognite enforces this behavior, the requests result in a 400 Bad Request status.

Example: partition=1/3
Responses
200

The response for a successful files/list operation

400

The response for a failed request.

get/files
Request samples
const files = await client.files.list({filter: {mimeType: 'image/png'}});
Response samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "nextCursor": "string"
}