Download OpenAPI specification:Download
This is the reference documentation for the Cognite API with an overview of all the available methods.
Most resource types can be paginated, indicated by the field nextCursor
in the response.
By passing the value of nextCursor
as the cursor you will get the next page of limit
results.
Note that all parameters except cursor
has to stay the same.
If you want to download a lot of resources (let's say events), paginating through millions of records can be slow.
We support parallel retrieval through the partition
parameter, which has the format m/n
where n
is the amount of partitions you would like to split the entire data set into.
If you want to download the entire data set by splitting it into 10 partitions, you would do the following in parallel with m
running from 1 to 10:
/events
with partition=m/10
.partition
parameter needs to be passed to all subqueries.A user that is only manifested in an external IdP needs to authenticate towards that IdP and not Cognite directly. Our login endpoints gives some mechanism for both redirecting to the IdP for a given project as well as getting information about the currently authenticated user. For a service account manifested in CDF, there's no reason to logging in. To validate that the key is valid, you can ask for authentication information about the logged in entity.
Returns the authentication information about the asking entity.
const status = await client.login.status(); // if status === null means you are not logged in
{- "data": {
- "user": "tom@example.com",
- "loggedIn": true,
- "project": "digitalrevolution",
- "projectId": 137238723719,
- "apiKeyId": 0
}
}
Redirects to a login URL. This endpoint is typically used by front-end services acting on behalf of users to log them in.
project required | string The project to login to. |
redirectUrl required | string The url to send the user to after the login is successful. |
errorRedirectUrl | string The url to send the user to if the login fails or is aborted. If this is not passed in, the value of the redirectUrl will be used. |
import { CogniteClient, REDIRECT } from '@cognite/sdk'; const client = new CogniteClient({ appId: '[YOUR APP NAME]' }); // using Cognite authentication flow client.loginWithOAuth({ project: '[PROJECT]', onAuthenticate: REDIRECT // optional, REDIRECT is by default }); // or you can sign in using AzureAD authentication flow (in case your projects supports it) client.loginWithOAuth({ cluster: '[CLUSTER]', clientId: '[CLIENT_ID]', // client id of your AzureAD application tenantId: '[TENANT_ID]', // tenant id of your AzureAD tenant. Will be set to 'common' if not provided }); // you also have ability to sign in using ADFS client.loginWithOAuth({ authority: https://example.com/adfs/oauth2/authorize, requestParams: { cluster: 'cluster-name', clientId: 'adfs-client-id', }, }); // after sign in you can do calls with the client (async () => { await client.authenticate(); client.setProject('project-name'); const createdAsset = await client.assets.create([{ name: 'My first asset' }]); })();
Ask this with any valid credentials to obtain information about the current authenticated entity. The response is a decoded ID token.
{- "sub": "tom@example.com",
- "project_name": "digitalrevolution",
- "groups": [
- 123982398,
- 123981283723,
- 7283273927
], - "signing_key": "a769f8ef-d5e3-4cf7-b914-2a6de189d942",
- "exp": 1554897484
}
Logging out a user means invalidating the token granted by CDF on the behalf of the external IdP. Optionally, you can also get a logout url to log out of the IdP itself (Azure AD, Google etc.). Logging out is only effective for tokens (not api keys).
Get logout url of the given project.
redirectUrl | string Example: redirectUrl=https://mysite.com/loggedout The url to send the user to after the logout is successful. If no url is passed, you will end up at the IdP's log out page. |
// You can specify the url to send the user to after the logout is successful. // If no url is passed, you will end up at the IDPs log out page. const logoutUrl = await client.logout.getUrl({ redirectUrl: '[url to redirect]' });
{
}
Projects are used to isolate data in CDF from each other. All objects in CDF belong to a single project, and objects in different projects are generally isolated from each other.
The list of all projects that the user has the 'list projects' capability in. The user may not have access to any resources in the listed projects, even if they have access to list the project itself.
{- "items": [
- {
- "urlName": "publicdata"
}
]
}
Retrieves information about a project given the project URL name.
project required | string Example: publicdata The project name. |
const projectInfo = await client.projects.retrieve('publicdata');
{- "name": "Open Industrial Data",
- "urlName": "publicdata",
- "defaultGroupId": 123871937,
- "authentication": {
- "validDomains": [
- "example.com",
- "google.com"
], - "applicationDomains": [
- "console.cognitedata.com",
- "cdfapplication.example.com"
]
}, - "oidcConfiguration": {
- "jwksUrl": "string",
- "tokenUrl": "string",
- "issuer": "string",
- "audience": "string",
- "skewMs": 0,
- "accessClaims": [
- {
- "claimName": "string"
}
], - "scopeClaims": [
- {
- "claimName": "string"
}
], - "logClaims": [
- {
- "claimName": "string"
}
], - "isGroupCallbackEnabled": false,
- "identityProviderScope": "string"
}
}
Updates the project configuration.
Warning: Updating a project will invalidate active sessions within that project.
project required | string Project url name |
Object with updated project configuration.
required | object (ProjectUpdateObjectDTO) Contains the instructions on how to update the project. Note: azureADConfiguration, oidcConfiguration and oAuth2Configuration are mutually exclusive |
{- "update": {
- "name": {
- "set": "string"
}, - "defaultGroupId": {
- "set": 0
}, - "validDomains": {
- "set": [
- "string"
]
}, - "applicationDomains": {
- "set": [
- "string"
]
}, - "authenticationProtocol": {
- "set": "string"
}, - "azureADConfiguration": {
- "set": {
- "appId": "string",
- "appSecret": "string",
- "tenantId": "string",
- "appResourceId": "string"
}
}, - "oAuth2Configuration": {
- "set": {
- "loginUrl": "string",
- "logoutUrl": "string",
- "tokenUrl": "string",
- "clientId": "string",
- "clientSecret": "string"
}
}, - "oidcConfiguration": {
- "modify": {
- "jwksUrl": {
- "set": "string"
}, - "tokenUrl": {
- "set": "string"
}, - "issuer": {
- "set": "string"
}, - "audience": {
- "set": "string"
}, - "skewMs": {
- "set": 0
}, - "accessClaims": {
- "set": [
- {
- "claimName": "string"
}
]
}, - "scopeClaims": {
- "set": [
- {
- "claimName": "string"
}
]
}, - "logClaims": {
- "set": [
- {
- "claimName": "string"
}
]
}, - "isGroupCallbackEnabled": {
- "set": true
}, - "identityProviderScope": {
- "set": "string"
}
}
}
}
}
{- "name": "Open Industrial Data",
- "urlName": "publicdata",
- "defaultGroupId": 123871937,
- "authentication": {
- "validDomains": [
- "example.com",
- "google.com"
], - "applicationDomains": [
- "console.cognitedata.com",
- "cdfapplication.example.com"
]
}, - "oidcConfiguration": {
- "jwksUrl": "string",
- "tokenUrl": "string",
- "issuer": "string",
- "audience": "string",
- "skewMs": 0,
- "accessClaims": [
- {
- "claimName": "string"
}
], - "scopeClaims": [
- {
- "claimName": "string"
}
], - "logClaims": [
- {
- "claimName": "string"
}
], - "isGroupCallbackEnabled": false,
- "identityProviderScope": "string"
}
}
Groups are used to give principals (service accounts or users) the capabilities to access CDF resources. One principal can be a member in multiple groups and one group can have multiple members. Note that having more than 20 groups per principal is not supported and may result in login issues.
Retrieves a list of groups the asking service account is a member of. Service accounts with groups:list capability can optionally ask for all groups in a project.
project required | string Example: publicdata The project name. |
all | boolean Default: false Whether to get all groups, only available with the groups:list acl. |
const groups = await client.groups.list({ all: true });
{- "items": [
- {
- "name": "Production Engineers",
- "sourceId": "b7c9a5a4-99c2-4785-bed3-5e6ad9a78603",
- "capabilities": [
- {
- "groupsAcl": {
- "actions": [
- "LIST"
], - "scope": {
- "all": { }
}
}
}
], - "id": 0,
- "isDeleted": false,
- "deletedTime": 0
}
]
}
Creates one or more named groups, each with a set of capabilities.
project required | string Example: publicdata The project name. |
List of groups to create.
required | Array of objects (GroupSpec) |
{- "items": [
- {
- "name": "Production Engineers",
- "sourceId": "b7c9a5a4-99c2-4785-bed3-5e6ad9a78603",
- "capabilities": [
- {
- "groupsAcl": {
- "actions": [
- "LIST"
], - "scope": {
- "all": { }
}
}
}
]
}
]
}
{- "items": [
- {
- "name": "Production Engineers",
- "sourceId": "b7c9a5a4-99c2-4785-bed3-5e6ad9a78603",
- "capabilities": [
- {
- "groupsAcl": {
- "actions": [
- "LIST"
], - "scope": {
- "all": { }
}
}
}
], - "id": 0,
- "isDeleted": false,
- "deletedTime": 0
}
]
}
Deletes the groups with the given IDs.
project required | string Example: publicdata The project name. |
List of group IDs to delete
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
{ }
Retrieve a list of service accounts that are members of the group with the given ID.
project required | string Example: publicdata The project name. |
groupId required | integer <int64> ID of the group |
const serviceAccounts = await client.groups.listServiceAccounts(921923342342323);
{- "items": [
- {
- "name": "some-internal-service@example.com",
- "groups": [
- 238712387,
- 1283712837,
- 1238712387
], - "id": 0,
- "isDeleted": false,
- "deletedTime": 0
}
]
}
Grant the service accounts with the given IDs membership in a group. This operation is not idempotent: if any of the given service accounts is already a member of the group, the operation will fail. Note that linking a service account to more than 20 groups is not supported and may result in login issues.
project required | string Example: publicdata The project name. |
groupId required | integer <int64> ID of the group |
IDs of service accounts to add
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
{- "code": 400,
- "message": "string",
- "missingFields": [
- { }
]
}
Revoke membership in a group from the given service accounts.
project required | string Example: publicdata The project name. |
groupId required | integer <int64> ID of the group |
List of service account IDs to remove
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
Manage service accounts for a specific project. A service account can be used to give applications access to CDF through the use of API keys.
Lists all the service accounts of the project.
project required | string Example: publicdata The project name. |
const serviceaccounts = await client.serviceAccounts.list();
{- "items": [
- {
- "name": "some-internal-service@example.com",
- "groups": [
- 238712387,
- 1283712837,
- 1238712387
], - "id": 0,
- "isDeleted": false,
- "deletedTime": 0
}
]
}
Creates new service accounts with the given names and group memberships. The names of the service accounts have to be unique. If any of the provided group IDs are not valid group IDs, the request will fail and no service accounts will be created.
project required | string Example: publicdata The project name. |
List of service accounts to create.
required | Array of objects (ServiceAccountInput) |
{- "items": [
- {
- "name": "some-internal-service@example.com",
- "groups": [
- 238712387,
- 1283712837,
- 1238712387
]
}
]
}
{- "items": [
- {
- "name": "some-internal-service@example.com",
- "groups": [
- 238712387,
- 1283712837,
- 1238712387
], - "id": 0,
- "isDeleted": false,
- "deletedTime": 0
}
]
}
Deletes the service accounts identified by the given IDs. API keys associated with those service accounts will also be deleted. If any of the provided IDs are not valid service account IDs, the request will fail and no resources will be deleted.
project required | string Example: publicdata The project name. |
List of service account IDs to delete
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
{ }
Manage API keys for a specific project. API keys are used to give service accounts access to the CDF API.
Retrieves a list of all API keys connected to the current service account. Administrators can optionally list keys for all or individual service accounts that are not their own.
project required | string Example: publicdata The project name. |
all | boolean Default: false Only available with users:list ACL, returns all API keys for the project. |
serviceAccountId | integer <int64> Get API keys for a specific service account, only available to admin users. |
includeDeleted | boolean Default: false Whether to include deleted API keys, or not. Deleted API keys can be listed for up to 90 days after deletion. |
const apiKeys = await client.apiKeys.list({ all: true });
{- "items": [
- {
- "id": 91723917823,
- "serviceAccountId": 1283712837,
- "createdTime": 1554897980221,
- "status": "ACTIVE"
}
]
}
Creates one API key for each service account. If the ID of one service account appears multiple times in the request, then multiple API keys will be created for that service account.
project required | string Example: publicdata The project name. |
List of the service accounts to create API keys for.
required | Array of objects (ApiKeyRequest) |
{- "items": [
- {
- "serviceAccountId": 0
}
]
}
{- "items": [
- {
- "id": 0,
- "serviceAccountId": 0,
- "createdTime": 0,
- "status": "ACTIVE",
- "value": "MQ23y87QSDKIJSd87287sdJkjsd"
}
]
}
Deletes one or more API keys with the specified API key IDs. The API key IDs were returned when the keys were created, or can be obtained by listing all API keys. Deleted API keys can be listed for up to 90 days after deletion.
project required | string Example: publicdata The project name. |
List of the IDs of the API keys to delete.
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
{ }
Manage security categories for a specific project. Security categories can be used to restrict access to a resource. Applying a security category to a resource means that only principals (users or service accounts) that also have this security category can access the resource. To learn more about security categories please read this page.
Retrieves a list of all security categories for a project.
project required | string Example: publicdata The project name. |
sort | string Default: "ASC" Enum: "ASC" "DESC" Sort descending or ascending. |
cursor | string Cursor to use for paging through results. |
limit | integer <int32> <= 1000 Default: 25 Return up to this many results. Maximum is 1000. Default is 25. |
const securityCategories = await client.securityCategories.list({ sort: 'ASC' });
{- "items": [
- {
- "name": "Guarded by vendor x",
- "id": 0
}
], - "nextCursor": "string"
}
Creates security categories with the given names. Duplicate names in the request are ignored. If a security category with one of the provided names exists already, then the request will fail and no security categories are created.
project required | string Example: publicdata The project name. |
List of categories to create
required | Array of objects (SecurityCategorySpecDTO) non-empty |
{- "items": [
- {
- "name": "Guarded by vendor x"
}
]
}
{- "items": [
- {
- "name": "Guarded by vendor x",
- "id": 0
}
]
}
Deletes the security categories that match the provided IDs. If any of the provided IDs does not belong to an existing security category, then the request will fail and no security categories are deleted.
project required | string Example: publicdata The project name. |
List of security category IDs to delete.
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
{ }
Sessions are used to maintain access to CDF resources for an extended period of time. The methods available to extend a sessions lifetime are client credentials and token exchange. Sessions depend on the project OIDC configuration and may become invalid in the following cases
Project OIDC configuration has been updated through the update project endpoint. This action invalidates all of the project's sessions.
The session was invalidated through the identity provider.
List all sessions in the current project.
project required | string Example: publicdata The project name. |
status | string Enum: "ready" "active" "cancelled" "revoked" "access_lost" If given, only sessions with the given status are returned. |
cursor | string Cursor to use for paging through results. |
limit | integer <int32> <= 1000 Default: 25 Return up to this many results. Maximum is 1000. Default is 25. |
{- "items": [
- {
- "id": 0,
- "type": "CLIENT_CREDENTIALS",
- "status": "READY",
- "creationTime": 0,
- "expirationTime": 0,
- "clientId": 0
}
], - "nextCursor": "string",
- "previousCursor": "string"
}
Create sessions
project required | string Example: publicdata The project name. |
A request containing the information needed to create a session.
Array of CreateSessionWithClientCredentialsRequest (object) or CreateSessionWithTokenExchangeRequest (object) (CreateSessionRequest) = 1 items |
{- "items": [
- {
- "clientId": "string",
- "clientSecret": "string"
}
]
}
{- "items": [
- {
- "id": 0,
- "type": "CLIENT_CREDENTIALS",
- "status": "READY",
- "nonce": "string",
- "clientId": "string"
}
]
}
Retrieves sessions with given IDs. The request will fail if any of the IDs does not belong to an existing session.
project required | string Example: publicdata The project name. |
List of session IDs to retrieve
items required | Array of integers <int64> non-empty unique [ items <int64 > ] |
{- "items": [
- 23872937137,
- 1238712837,
- 128371973
]
}
{- "items": [
- {
- "id": 105049194919491,
- "type": "TOKEN_EXCHANGE",
- "status": "ACTIVE",
- "creationTime": 1638795559528,
- "expirationTime": 1638795559628
}
]
}
Revoke access to a session. Revocation of a session may in some cases take up to 1 hour to take effect.
project required | string Example: publicdata The project name. |
A request containing the information needed to revoke sessions.
Array of objects (RevokeSessionRequest) |
{- "items": [
- {
- "id": 0
}
]
}
{- "items": [
- {
- "id": 0,
- "type": "CLIENT_CREDENTIALS",
- "status": "REVOKED",
- "creationTime": 1638795554528,
- "expirationTime": 1638795554528,
- "clientId": 0
}
]
}
{- "subject": "string",
- "projects": [
- {
- "projectUrlName": "string",
- "groups": [
- 0
]
}
], - "capabilities": [
- {
- "groupsAcl": {
- "actions": [
- "LIST"
], - "scope": {
- "all": { }
}
}, - "projectScope": {
- "allProjects": { }
}
}
]
}
The assets resource type stores digital representations of objects or groups of objects from the physical world. Assets are organized in hierarchies. For example, a water pump asset can be part of a subsystem asset on an oil platform asset.
List all assets, or only the assets matching the specified query.
project required | string Example: publicdata The project name. |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
includeMetadata | boolean Default: true Whether the metadata field should be returned, or not. |
name | string (AssetName) [ 1 .. 140 ] characters The name of the asset. |
parentIds | string <jsonArray(int64)> (JsonArrayInt64) Example: parentIds=[363848954441724, 793045462540095, 1261042166839739] List only assets that have one of the parentIds as a parent. The parentId for root assets is null. |
parentExternalIds | string <jsonArray(string)> (JsonArrayString) Example: parentExternalIds=[externalId_1, externalId_2, externalId_3] List only assets that have one of the parentExternalIds as a parent. The parentId for root assets is null. |
rootIds | string <jsonArray(int64)> (JsonArrayInt64) Deprecated Example: rootIds=[363848954441724, 793045462540095, 1261042166839739] This parameter is deprecated. Use assetSubtreeIds instead. List only assets that have one of the rootIds as a root asset. A root asset is its own root asset. |
assetSubtreeIds | string <jsonArray(int64)> (JsonArrayInt64) Example: assetSubtreeIds=[363848954441724, 793045462540095, 1261042166839739] List only assets that are 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. |
assetSubtreeExternalIds | string <jsonArray(string)> (JsonArrayString) Example: assetSubtreeExternalIds=[externalId_1, externalId_2, externalId_3] List only assets that are in a subtree rooted at any of these assetExternalIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned. |
source | string <= 128 characters The source of the asset, for example which database it's from. |
root | boolean Default: false Whether the filtered assets are root assets, or not. Set to True to only list root assets. |
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. |
externalIdPrefix | string (CogniteExternalIdPrefix) <= 255 characters Example: externalIdPrefix=my.known.prefix Filter by this (case-sensitive) prefix for the external ID. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
const assets = await client.assets.list({ filter: { name: '21PT1019' } });
{- "items": [
- {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
], - "nextCursor": "string"
}
You can create a maximum of 1000 assets per request.
project required | string Example: publicdata The project name. |
List of the assets to create. You can create a maximum of 1000 assets per request.
required | Array of objects (DataExternalAssetItem) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "parentId": 1,
- "parentExternalId": "my.known.id",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}
}
]
}
{- "items": [
- {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
]
}
Retrieve an asset by its ID. If you want to retrieve assets by externalIds, use Retrieve assets instead.
project required | string Example: publicdata The project name. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
const assets = await client.assets.retrieve([{id: 123}, {externalId: 'abc'}]);
{- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
Use advanced filtering options to find assets.
project required | string Example: publicdata The project name. |
object (Filter) Filter on assets with strict matching. | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
aggregatedProperties | Array of strings (AggregatedProperty) Items Enum: "childCount" "path" "depth" Set of aggregated properties to include |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "filter": {
- "name": "string",
- "parentIds": [
- 1
], - "parentExternalIds": [
- "my.known.id"
], - "rootIds": [
- {
- "id": 1
}
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "root": true,
- "externalIdPrefix": "my.known.prefix",
- "labels": {
- "containsAny": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "relation": "INTERSECTS",
- "shape": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}
}
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "aggregatedProperties": [
- "childCount"
], - "partition": "1/10"
}
{- "items": [
- {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
], - "nextCursor": "string"
}
Use advanced filtering options to agggregate assets.
project required | string Example: publicdata The project name. |
object (Filter) Filter on assets with strict matching. | |
aggregate | string Default: "count" Enum: "metadataKeys" "metadataValues" "count" Type of aggregation to apply.
|
keys | Array of strings <= 1 items For |
{- "filter": {
- "name": "string",
- "parentIds": [
- 1
], - "parentExternalIds": [
- "my.known.id"
], - "rootIds": [
- {
- "id": 1
}
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "root": true,
- "externalIdPrefix": "my.known.prefix",
- "labels": {
- "containsAny": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "relation": "INTERSECTS",
- "shape": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}
}
}, - "aggregate": "metadataKeys",
- "keys": [
- "string"
]
}
{- "items": [
- {
- "count": 0
}
]
}
Retrieve assets by IDs or external IDs. If you specify to get aggregates then be aware that the aggregates are eventually consistent.
project required | string Example: publicdata The project name. |
All provided IDs and external IDs must be unique.
required | Array of AssetInternalId (object) or AssetExternalId (object) (AssetIdEither) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
aggregatedProperties | Array of strings (AggregatedProperty) Items Enum: "childCount" "path" "depth" Set of aggregated properties to include |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false,
- "aggregatedProperties": [
- "childCount"
]
}
{- "items": [
- {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
]
}
Update the attributes of assets.
project required | string Example: publicdata The project name. |
All provided IDs and external IDs must be unique. Fields that are not included in the request, are not changed.
required | Array of AssetChangeById (object) or AssetChangeByExternalId (object) (AssetChange) [ 1 .. 1000 ] items |
{- "items": [
- {
- "update": {
- "externalId": {
- "set": "my.known.id"
}, - "name": {
- "set": "string"
}, - "description": {
- "set": "string"
}, - "dataSetId": {
- "set": 0
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}, - "source": {
- "set": "string"
}, - "parentId": {
- "set": 1
}, - "parentExternalId": {
- "set": "my.known.id"
}, - "labels": {
- "add": [
- {
- "externalId": "my.known.id"
}
], - "remove": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "set": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}
}
}, - "id": 1
}
]
}
{- "items": [
- {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
]
}
Fulltext search for assets based on result relevance. Primarily meant for human-centric use-cases, not for programs, since matching and ordering may change over time. Additional filters can also be specified. This operation does not support pagination.
project required | string Example: publicdata The project name. |
Search query
object (Filter) Filter on assets with strict matching. | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
object (Search) Fulltext search for assets. Primarily meant for for human-centric use-cases, not for programs. The query parameter uses a different search algorithm than the deprecated name and description parameters, and will generally give much better results. |
{- "filter": {
- "parentIds": [
- 1293812938,
- 293823982938
]
}, - "search": {
- "name": "flow",
- "description": "upstream"
}
}
{- "items": [
- {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
]
}
Delete assets. By default, recursive=false
and the request would fail if attempting to delete assets that are referenced as parent by other assets. To delete such assets and all its descendants, set recursive to true. The limit of the request does not include the number of descendants that are deleted.
project required | string Example: publicdata The project name. |
required | Array of AssetInternalId (object) or AssetExternalId (object) (AssetIdEither) [ 1 .. 1000 ] items |
recursive | boolean Default: false Recursively delete all asset subtrees under the specified IDs. |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "recursive": false,
- "ignoreUnknownIds": false
}
{ }
A time series consists of a sequence of data points connected to a single asset.
For example: A water pump asset can have a temperature time series that records a data point in units of °C every second.
A single asset can have several time series. The water pump could have additional time series measuring pressure within the pump, rpm, flow volume, power consumption, and more.
Time series store data points as either number or strings. This is controlled by the is_string flag on the time series object. Numerical data points can be aggregated before they are returned from a query (e.g., to find the average temperature for a day). String data points, on the other hand, cannot be aggregated by CDF, but can store arbitrary information like states (e.g. “open”/”closed”) or more complex information (JSON).
Cognite stores discrete data points, but the underlying process measured by the data points can vary continuously. When interpolating between data points, we can either assume that each value stays the same until the next measurement, or that it linearly changes between the two measurements. This is controlled by the is_step flag on the time series object. For example, if we estimate the average over a time containing two data points, the average will either be close to the first (is step) or close to the mean of the two (not is step).
A data point stores a single piece of information, a number or a string, associated with a specific time. Data points are identified by their timestamps, measured in milliseconds since the unix epoch -- 00:00, January 1st, 1970. Timestamps are in the range from 00:00, January 1st, 1900 to 23:59, December 31st, 2050. Negative timestamps are used to define dates before 1970. Milliseconds is the finest time resolution supported by CDF i.e. fractional milliseconds are not supported. Leap seconds are not counted.
Numerical data points can be aggregated before they are retrieved from CDF. This allows for faster queries by reducing the amount of data transferred. You can aggregate data points by specifying one or more aggregates (e.g. average, minimum, maximum) as well as the time granularity over which the aggregates should be applied (e.g. “1h” for one hour).
Aggregates are aligned to the start time modulo the granularity unit. For example, if you ask for daily average temperatures since Monday afternoon last week, the first aggregated data point will contain averages for Monday, the second for Tuesday, etc. Determining aggregate alignment without considering data point timestamps allows CDF to pre-calculate aggregates (e.g. to quickly return daily average temperatures for a year). As a consequence, aggregating over 60 minutes can return a different result that aggregating over 1 hour because the two queries will be aligned differently.
Asset references obtained from a time series - through its asset id - may be invalid, simply by the non-transactional nature of HTTP. They are maintained in an eventual consistent manner.
List time series. Use nextCursor to paginate through the results.
project required | string Example: publicdata The project name. |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. CDF returns a maximum of 1000 results even if you specify a higher limit. |
includeMetadata | boolean Default: true Whether the metadata field should be returned, or not. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
assetIds | string <jsonArray(int64)> (JsonArrayInt64) Example: assetIds=[363848954441724, 793045462540095, 1261042166839739] Get the time series related to the assets. The format is a list of IDs serialized as a JSON array(int64). Takes [ 1 .. 100 ] unique items. |
rootAssetIds | string <jsonArray(int64)> (JsonArrayInt64) Example: rootAssetIds=[363848954441724, 793045462540095, 1261042166839739] Only include time series that have a related asset in a tree rooted at any of these root assetIds. |
externalIdPrefix | string (CogniteExternalIdPrefix) <= 255 characters Example: externalIdPrefix=my.known.prefix Filter by this (case-sensitive) prefix for the external ID. |
const timeseries = await client.timeseries.list({ filter: { assetIds: [1, 2] }});
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Create one or more time series.
project required | string Example: publicdata The project name. |
required | Array of objects (PostTimeSeriesMetadataDTO) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "legacyName": "string",
- "isString": false,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": false,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1
}
]
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Retrieve one or more time series by ID or external ID. The time series are returned in the same order as in the request.
project required | string Example: publicdata The project name. |
List of the IDs of the time series to retrieve.
required | Array of QueryWithInternalId (object) or QueryWithExternalId (object) [ 1 .. 1000 ] items unique List of ID objects |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Retrieves a list of time series matching the specified criteria. This operation supports pagination by cursor. Criteria can be applied to select a subset of time series.
project required | string Example: publicdata The project name. |
object (Filter) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Return up to this many results. |
cursor | string |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "filter": {
- "name": "string",
- "unit": "string",
- "isString": true,
- "isStep": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "my.known.id"
], - "rootAssetIds": [
- 343099548723932,
- 88483999203217
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "externalIdPrefix": "my.known.prefix",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "partition": "1/10"
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Count the number of time series that match the given filter
project required | string Example: publicdata The project name. |
Retrieves the count of time series matching the given criteria
object (Filter) |
{- "filter": {
- "name": "string",
- "unit": "string",
- "isString": true,
- "isStep": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "my.known.id"
], - "rootAssetIds": [
- 343099548723932,
- 88483999203217
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "externalIdPrefix": "my.known.prefix",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}
}
}
{- "items": [
- {
- "count": 137
}
]
}
Fulltext search for time series based on result relevance. Primarily meant for human-centric use-cases, not for programs, since matching and ordering may change over time. Additional filters can also be specified. This operation does not support pagination.
project required | string Example: publicdata The project name. |
object (Filter) | |
object (Search) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Return up to this many results. |
{- "filter": {
- "name": "string",
- "unit": "string",
- "isString": true,
- "isStep": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "my.known.id"
], - "rootAssetIds": [
- 343099548723932,
- 88483999203217
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "externalIdPrefix": "my.known.prefix",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}
}, - "search": {
- "name": "string",
- "description": "string",
- "query": "some other"
}, - "limit": 100
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Updates one or more time series. Fields that are not included in the request, are not changed.
For primitive fields (String, Long Int), use 'set': 'value' to update the value; use 'setNull': true to set the field to null.
For JSON Array fields (for example securityCategories), use 'set': [value1, value2] to update the value; use 'add': [v1, v2] to add values; use 'remove': [v1, v2] to remove values.
project required | string Example: publicdata The project name. |
List of changes.
required | Array of TimeSeriesUpdateById (object) or TimeSeriesUpdateByExternalId (object) (TimeSeriesUpdate) [ 1 .. 1000 ] items |
{- "items": [
- {
- "update": {
- "externalId": {
- "set": "string"
}, - "name": {
- "set": "string"
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}, - "unit": {
- "set": "string"
}, - "assetId": {
- "set": 0
}, - "isStep": {
- "set": true
}, - "description": {
- "set": "string"
}, - "securityCategories": {
- "set": [
- 0
]
}, - "dataSetId": {
- "set": 0
}
}, - "id": 1
}
]
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Deletes the time series with the specified IDs and their datapoints.
project required | string Example: publicdata The project name. |
Specify a list of the time series to delete.
required | Array of QueryWithInternalId (object) or QueryWithExternalId (object) [ 1 .. 1000 ] items unique List of ID objects |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{ }
Insert datapoints into a time series. You can do this for multiple time series. If you insert a datapoint with a timestamp that already exists, it will be overwritten with the new value.
project required | string Example: publicdata The project name. |
The datapoints to insert.
required | Array of DatapointsWithInternalId (object) or DatapointsWithExternalId (object) (DatapointsPostDatapoint) [ 1 .. 10000 ] items |
{- "items": [
- {
- "datapoints": [
- {
- "timestamp": -2208988800000,
- "value": 0
}
], - "id": 1
}
]
}
{ }
Retrieves a list of data points from multiple time series in a project. This operation supports aggregation, but not pagination. A detailed description of how aggregates work can be found at our concept guide for aggregation.
Note: when the 'start' is not specified neither in top level and for individual item it will default to epoch 0 which is Jan 1st, 1970 thus, excluding potential existent datapoints before 1970. 'start' needs to be specified to get datapoints before 1970.
project required | string Example: publicdata The project name. |
Specify parameters to query for multiple datapoints. If you omit fields in individual datapoint query items, the top-level field values are used. For example, you can specify a default limit for all items by setting the top-level limit field. If you request aggregates, only the aggregates are returned. If you don't request any aggregates, all data points are returned.
required | Array of QueryWithInternalId (object) or QueryWithExternalId (object) (DatapointsQuery) [ 1 .. 100 ] items |
integer or string (TimestampOrStringStart) Get datapoints starting from, and including, this time. The format is N[timeunit]-ago where timeunit is w,d,h,m,s. Example: '2d-ago' gets datapoints that are up to 2 days old. You can also specify time in milliseconds since epoch. Note that for aggregates, the start time is rounded down to a whole granularity unit (in UTC timezone). Daily granularities (d) are rounded to 0:00 AM; hourly granularities (h) to the start of the hour, etc. | |
integer or string (TimestampOrStringEnd) Get datapoints up to, but excluding, this point in time. Same format as for start. Note that when using aggregates, the end will be rounded up such that the last aggregate represents a full aggregation interval containing the original end, where the interval is the granularity unit times the granularity multiplier. For granularity 2d, the aggregation interval is 2 days, if end was originally 3 days after the start, it will be rounded to 4 days after the start. | |
limit | integer <int32> Default: 100 Return up to this number of datapoints. The maximum is 100000 non-aggregated data points and 10000 aggregated data points in total across all queries in a single request. |
aggregates | Array of strings (Aggregate) [ 1 .. 10 ] items unique Items Enum: "average" "max" "min" "count" "sum" "interpolation" "stepInterpolation" "totalVariation" "continuousVariance" "discreteVariance" Specify the aggregates to return, or an empty array if this sub-query should return datapoints without aggregation. This value overrides a top-level default aggregates list. |
granularity | string The time granularity size and unit to aggregate over. Valid entries are 'day, hour, minute, second', or short forms 'd, h, m, s', or a multiple of these indicated by a number as a prefix. For 'second' and 'minute' the multiple must be an integer betwen 1 and 120 inclusive, for 'hour' and 'day' the multiple must be an integer between 1 and 100000 inclusive. For example, a granularity '5m' means that aggregates are calculated over 5 minutes. This field is required if aggregates are specified. |
includeOutsidePoints | boolean Default: false Whether to include the last datapoint before the requested time period, and the first one after. This option can be useful for interpolating data. It is not available for aggregates. Note: If there are more than |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "start": 0,
- "end": 0,
- "limit": 0,
- "aggregates": [
- "average"
], - "granularity": "1h",
- "includeOutsidePoints": false,
- "id": 1
}
], - "start": 0,
- "end": 0,
- "limit": 100,
- "aggregates": [
- "average"
], - "granularity": "1h",
- "includeOutsidePoints": false,
- "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "isString": false,
- "isStep": true,
- "unit": "string",
- "datapoints": [
- {
- "timestamp": 0,
- "average": 0,
- "max": 0,
- "min": 0,
- "count": 0,
- "sum": 0,
- "interpolation": 0,
- "stepInterpolation": 0,
- "continuousVariance": 0,
- "discreteVariance": 0,
- "totalVariation": 0
}
]
}
]
}
Retrieves the latest data point in a time series.
project required | string Example: publicdata The project name. |
The list of the queries to perform.
required | Array of QueryWithInternalId (object) or QueryWithExternalId (object) (LatestDataBeforeRequest) [ 1 .. 100 ] items List of latest queries |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "before": "now",
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "isString": true,
- "isStep": true,
- "unit": "string",
- "datapoints": [
- {
- "timestamp": 0,
- "value": 0
}
]
}
]
}
Delete datapoints from time series.
project required | string Example: publicdata The project name. |
The list of delete requests to perform.
required | Array of QueryWithInternalId (object) or QueryWithExternalId (object) (DatapointsDeleteRequest) [ 1 .. 10000 ] items List of delete filters |
{- "items": [
- {
- "inclusiveBegin": 1638795554528,
- "exclusiveEnd": 1638795554528,
- "id": 1
}
]
}
{ }
Synthetic Time Series (STS) is a way to combine various input time series, constants and operators, to create completely new time series.
For example can we use the expression 24 * TS{externalId='production/hour'}
to convert from hourly to daily production rates.
But STS is not limited to simple conversions.
TS{id=123} + TS{externalId='hei'}
.sin(pow(TS{id=123}, 2))
.TS{id=123, aggregate='average', granularity='1h'}+TS{id=456}
To learn more about synthetic time series please follow our guide.
Execute an on-the-fly synthetic query
project required | string Example: publicdata The project name. |
The list of queries to perform
required | Array of objects (SyntheticQuery) [ 1 .. 10 ] items |
{- "items": [
- {
- "expression": "(5 + TS{externalId='hello'}) / TS{id=123, aggregate='average', granularity='1h'}",
- "start": 0,
- "end": 0,
- "limit": 100
}
]
}
{- "items": [
- {
- "isString": false,
- "datapoints": [
- {
- "timestamp": 0,
- "value": 0
}
]
}
]
}
Event objects store complex information about multiple assets over a time period. For example, an event can describe two hours of maintenance on a water pump and some associated pipes, or a future time window where the pump is scheduled for inspection. This is in contrast with data points in time series that store single pieces of information about one asset at specific points in time (e.g., temperature measurements).
An event’s time period is defined by a start time and end time, both millisecond timestamps since the UNIX epoch. The timestamps can be in the future. In addition, events can have a text description as well as arbitrary metadata and properties.
Asset references obtained from an event - through asset ids - may be invalid, simply by the non-transactional nature of HTTP. They are maintained in an eventual consistent manner.
Creates multiple event objects in the same project. It is possible to post a maximum of 1000 events per request.
project required | string Example: publicdata The project name. |
List of events to be posted. It is possible to post a maximum of 1000 events per request.
required | Array of objects (ExternalEvent) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string"
}
]
}
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
]
}
List events optionally filtered on query parameters
project required | string Example: publicdata The project name. |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
minStartTime | integer <int64> (EpochTimestamp) >= 0 The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
maxStartTime | integer <int64> (EpochTimestamp) >= 0 The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
minEndTime | integer <int64> (EpochTimestamp) >= 0 The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
maxEndTime | integer <int64> (EpochTimestamp) >= 0 The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
minActiveAtTime | integer <int64> >= 0 Event is considered active from its startTime to endTime inclusive. If startTime is null, event is never active. If endTime is null, event is active from startTime onwards. activeAtTime filter will match all events that are active at some point from min to max, from min, or to max, depending on which of min and max parameters are specified. |
maxActiveAtTime | integer <int64> >= 0 Event is considered active from its startTime to endTime inclusive. If startTime is null, event is never active. If endTime is null, event is active from startTime onwards. activeAtTime filter will match all events that are active at some point from min to max, from min, or to max, depending on which of min and max parameters are specified. |
assetIds | string <jsonArray(int64)> (JsonArrayInt64) Example: assetIds=[363848954441724, 793045462540095, 1261042166839739] Asset IDs of equipment that this event relates to. Format is list of IDs serialized as JSON array(int64). Takes [ 1 .. 100 ] of unique items. |
assetExternalIds | string <jsonArray(string)> (JsonArrayString) Example: assetExternalIds=["externalId1", "externalId2", "externalId3"] Asset external IDs of equipment that this event relates to. Takes 1..100 unique items. |
assetSubtreeIds | string <jsonArray(int64)> (JsonArrayInt64) Example: assetSubtreeIds=[363848954441724, 793045462540095, 1261042166839739] Only include events 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. |
assetSubtreeExternalIds | string <jsonArray(string)> (JsonArrayString) Example: assetSubtreeExternalIds=["externalId1", "externalId2", "externalId3"] Only include events 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. |
source | string <= 128 characters The source of this event. |
type | string (EventType) <= 64 characters Type of the event, e.g 'failure'. |
subtype | string (EventSubType) <= 64 characters SubType of the event, e.g 'electrical'. |
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. |
externalIdPrefix | string (CogniteExternalIdPrefix) <= 255 characters Example: externalIdPrefix=my.known.prefix Filter by this (case-sensitive) prefix for the external ID. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
includeMetadata | boolean Default: true Whether the metadata field should be returned, or not. |
sort | Array of strings Example: sort=endTime:desc Sort by array of selected fields. Syntax: |
const events = await client.events.list({ filter: { startTime: { min: new Date('1 jan 2018') }, endTime: { max: new Date('1 jan 2019') } } });
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
], - "nextCursor": "string"
}
project required | string Example: publicdata The project name. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
const events = await client.events.retrieve([{id: 123}, {externalId: 'abc'}]);
{- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
Retrieve a list of all events in the same project. This operation supports pagination by cursor. Criteria can be applied to select a subset of events.
project required | string Example: publicdata The project name. |
object (EventFilter) Filter on events filter with exact match | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 <- Limits the maximum number of results to be returned by single request. In case there are more results to the request 'nextCursor' attribute will be provided as part of response. Request may contain less results than request limit. |
Array of objects (SortProperty) Sort by array of selected properties.
| |
cursor | string |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "filter": {
- "startTime": {
- "max": 0,
- "min": 0
}, - "endTime": {
- "max": 0,
- "min": 0
}, - "activeAtTime": {
- "max": 0,
- "min": 0
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "assetExternalIds": [
- "my.known.id"
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "source": "string",
- "type": "string",
- "subtype": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix"
}, - "limit": 100,
- "sort": [
- {
- "property": [
- "string"
], - "order": "asc"
}
], - "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "partition": "1/10"
}
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
], - "nextCursor": "string"
}
The aggregation API allows you to compute aggregated results on events like getting the count of all events in a project or checking what are all the different types and subtypes of events in your project, along with the count of events in each of those aggregations. By specifying an additional filter, you can also aggregate only among events matching the specified filter.
The default behavior, when you do not specify
the aggregate
field in the request body, is to return the count
of events.
Setting aggregate
to uniqueValues
will return all unique values (up to a
maximum of 1000) and the count of each in the field specified in
fields: []
. Note that, currently, you can only request for unique
values on a single field. Also, in the case of text fields, the values are
aggregated in a case-insensitive manner. For example:
{
"aggregate": "uniqueValues",
"fields": [ "type" ]
}
will return all unique 'types' in the events in your project.
Similarly,
{
"aggregate": "uniqueValues",
"fields": [ "dataSetId" ],
"filter": {
"subType": "subtype_1"
}
}
will return all unique dataSetIds in events of subtype 'subtype_1'
project required | string Example: publicdata The project name. |
fields required | Array of strings <= 1 items Items Enum: "type" "subtype" "dataSetId" The field name(s) to apply the aggregation on. Currently limited to one field. |
object (EventFilter) Filter on events filter with exact match | |
aggregate required | string Value: "uniqueValues" Type of aggregation to apply.
|
{- "filter": {
- "type": "type_1"
}, - "aggregate": "uniqueValues",
- "fields": [
- "subtype"
]
}
{- "items": [
- {
- "count": 10
}
]
}
Retrieves information about events in the same project. Events are returned in the same order as the ids listed in the query.
A maximum of 1000 event IDs may be listed per request and all of them must be unique.
project required | string Example: publicdata The project name. |
List of IDs of events to retrieve. Must be up to a maximum of 1000 IDs, and all of them must be unique.
required | Array of InternalId (object) or ExternalId (object) (EitherId) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
]
}
Updates events in the same project. This operation supports partial updates; Fields omitted from queries will remain unchanged on objects.
For primitive fields (String, Long, Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.
For the Json Array field (e.g. assetIds), use 'set': [value1, value2] to update value; use 'add': [v1, v2] to add values to current list of values; use 'remove': [v1, v2] to remove these values from current list of values if exists.
A maximum of 1000 events can be updated per request, and all of the event IDs must be unique.
project required | string Example: publicdata The project name. |
List of changes. A maximum of 1000 events can be updated per request, and all of the event IDs must be unique.
required | Array of EventChangeById (object) or EventChangeByExternalId (object) (EventChange) [ 1 .. 1000 ] items |
{- "items": [
- {
- "update": {
- "externalId": {
- "set": "my.known.id"
}, - "dataSetId": {
- "set": 0
}, - "startTime": {
- "set": 0
}, - "endTime": {
- "set": 0
}, - "description": {
- "set": "string"
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}, - "assetIds": {
- "set": [
- 0
]
}, - "source": {
- "set": "string"
}, - "type": {
- "set": "string"
}, - "subtype": {
- "set": "string"
}
}, - "id": 1
}
]
}
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
]
}
project required | string Example: publicdata The project name. |
object (EventFilter) Filter on events filter with exact match | |
object (EventSearch) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 <- Limits the maximum number of results to be returned by single request. Request may contain less results than request limit. |
{- "filter": {
- "startTime": {
- "max": 0,
- "min": 0
}, - "endTime": {
- "max": 0,
- "min": 0
}, - "activeAtTime": {
- "max": 0,
- "min": 0
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "assetExternalIds": [
- "my.known.id"
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "source": "string",
- "type": "string",
- "subtype": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix"
}, - "search": {
- "description": "string"
}, - "limit": 100
}
{- "items": [
- {
- "externalId": "my.known.id",
- "dataSetId": 1,
- "startTime": 0,
- "endTime": 0,
- "type": "string",
- "subtype": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "source": "string",
- "id": 1,
- "lastUpdatedTime": 0,
- "createdTime": 0
}
]
}
Deletes events with the given ids. A maximum of 1000 events can be deleted per request.
project required | string Example: publicdata The project name. |
List of IDs to delete.
required | Array of InternalId (object) or ExternalId (object) (EitherId) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{ }
A file stores a sequence of bytes connected to one or more assets. For example, a file can contain a piping and instrumentation diagram (P&IDs) showing how multiple assets are connected.
Each file is identified by the 'id' field, which is generated internally for each new file. Each file's 'id' field is unique within a project.
The 'externalId' field is optional, but can also be used to identify a file. The 'externalId' (if used) must be unique within a project.
Files are created in two steps; First the metadata is stored in a file object, and then the file contents are uploaded. This means that files can exist in a non-uploaded state. The upload state is reflected in the 'uploaded' field in responses.
Asset references obtained from a file - through asset ids - may be invalid, simply by the non-transactional nature of HTTP. They are maintained in an eventual consistent manner.
Create metadata information and get an upload link for a file.
To upload the file, use the uploadUrl link in the response in a separate request. To upload a file, send an HTTP PUT request to the uploadUrl with the relevant 'Content-Type' and 'Content-Length' headers.
If the uploadUrl contains the string '/v1/files/gcs_proxy/', you can make a Google Cloud Storage (GCS) resumable upload request as documented in https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload.
The uploadUrl expires after one week. Any file info entry that does not have the actual file uploaded within one week will be automatically deleted.
project required | string Example: publicdata The project name. |
overwrite | boolean Default: false If 'overwrite' is set to true, and the POST body content specifies a 'externalId' field, fields for the file found for externalId can be overwritten. The default setting is false. If metadata is included in the request body, all of the original metadata will be overwritten. The actual file will be overwritten after a successful upload with the uploadUrl from the response. If there is no successful upload, the current file contents will be kept. File-Asset mappings only change if explicitly stated in the assetIds field of the POST json body. Do not set assetIds in request body if you want to keep the current file-asset mappings. |
Origin | string The 'Origin' header parameter is required if there is a Cross Origin issue. |
Fields to be set for the file.
externalId | string (CogniteExternalId) <= 255 characters The external ID provided by the client. Must be unique for the resource type. |
name required | string (FileName) <= 256 characters Name of the file. |
directory | string (FileDirectory) <= 512 characters Directory containing the file. Must be an absolute, unix-style path. |
source | string (FileSource) <= 128 characters The source of the file. |
mimeType | string (MimeType) <= 256 characters File type. E.g. text/plain, application/pdf, .. |
object (FilesMetadataField) Custom, application specific metadata. String key -> String value. Limits: Maximum length of key is 128 bytes, value 10240 bytes, up to 256 key-value pairs, of total size at most 10240. | |
assetIds | Array of integers <int64> (CogniteInternalId) [ 1 .. 1000 ] items [ items <int64 > [ 1 .. 9007199254740991 ] ] |
dataSetId | integer <int64> (DataSetId) [ 1 .. 9007199254740991 ] The dataSet Id for the item. |
sourceCreatedTime | integer <int64> >= 0 The timestamp for when the file was originally created in the source system. |
sourceModifiedTime | integer <int64> >= 0 The timestamp for when the file was last modified in the source system. |
securityCategories | Array of integers <int64> (CogniteInternalId) [ 0 .. 100 ] items [ items <int64 > [ 1 .. 9007199254740991 ] ] The security category IDs required to access this file. |
Array of objects (LabelList) [ 0 .. 10 ] items unique A list of the labels associated with this resource item. | |
object (GeoLocation) Geographic metadata. |
{- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}
}
{- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "uploadUrl": "string"
}
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.
project required | string Example: publicdata The project name. |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
name | string (FileName) <= 256 characters Name of the file. |
mimeType | string (MimeType) <= 256 characters Example: mimeType=image/jpeg File type. E.g. text/plain, application/pdf, .. |
source | string (FileSource) <= 128 characters The source of the file. |
assetIds | Array of integers <int64> (AssetIds) [ 1 .. 100 ] items unique [ items <int64 > [ 1 .. 9007199254740991 ] ] Example: assetIds=363848954441724&assetIds=793045462540095&assetIds=1261042166839739 Only include files that reference these specific asset IDs. |
assetExternalIds | string <jsonArray(string)> (JsonArrayString) Example: assetExternalIds=["externalId1", "externalId2", "externalId3"] Asset external IDs of related equipment that this file relates to. Takes 1..100 unique items. |
Array of DataSetInternalId (object) or DataSetExternalId (object) (DataSetIdEithers) | |
rootAssetIds | string <jsonArray(int64)> (JsonArrayInt64) Example: rootAssetIds=[363848954441724, 793045462540095, 1261042166839739] Only include files that have a related asset in a tree rooted at any of these root assetIds. |
assetSubtreeIds | string <jsonArray(int64)> (JsonArrayInt64) Example: assetSubtreeIds=[363848954441724, 793045462540095, 1261042166839739] 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. |
assetSubtreeExternalIds | string <jsonArray(string)> (JsonArrayString) Example: assetSubtreeExternalIds=["externalId1", "externalId2", "externalId3"] 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. |
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 Example: externalIdPrefix=my.known.prefix Filter by this (case-sensitive) prefix for the external ID. |
uploaded | boolean Example: uploaded=true Whether or not the actual file is uploaded. This field is returned only by the API, it has no effect in a post body. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
const files = await client.files.list({filter: {mimeType: 'image/png'}});
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Returns file info for the file ID
project required | string Example: publicdata The project name. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
const files = await client.files.retrieve([{id: 123}, {externalId: 'abc'}]);
{- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
Retrieves a list of all files in a project. Criteria can be supplied to select a subset of files. This operation supports pagination with cursors.
project required | string Example: publicdata The project name. |
The project name
object | |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 <- Maximum number of items that the client want to get back. |
cursor | string |
{- "filter": {
- "name": "string",
- "directoryPrefix": "/my/known/directory",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "externalId1",
- "externalId2",
- "externalId3"
], - "rootAssetIds": [
- {
- "id": 123456789
}, - {
- "externalId": "system 99 external Id 1234"
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "assetSubtreeIds": [
- {
- "id": 123456789
}, - {
- "externalId": "system 99 external Id 1234"
}
], - "source": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "uploadedTime": {
- "max": 0,
- "min": 0
}, - "sourceCreatedTime": {
- "max": 0,
- "min": 0
}, - "sourceModifiedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix",
- "uploaded": true,
- "labels": {
- "containsAny": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "relation": "INTERSECTS",
- "shape": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}
}
}, - "partition": "1/10",
- "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Retrieves metadata information about multiple specific files in the same project. Results are returned in the same order as in the request. This operation does not return the file contents.
project required | string Example: publicdata The project name. |
List of IDs of files to retrieve. Must be up to a maximum of 1000 IDs, and all of them must be unique.
required | Array of Select by Id (object) or Select by ExternalId (object) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Search for files based on relevance. You can also supply a strict match filter as in Filter files, and search in the results from the filter. Returns first 1000 results based on relevance. This operation does not support pagination.
project required | string Example: publicdata The project name. |
object | |
object |
{- "filter": {
- "name": "string",
- "directoryPrefix": "/my/known/directory",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "externalId1",
- "externalId2",
- "externalId3"
], - "rootAssetIds": [
- {
- "id": 123456789
}, - {
- "externalId": "system 99 external Id 1234"
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "assetSubtreeIds": [
- {
- "id": 123456789
}, - {
- "externalId": "system 99 external Id 1234"
}
], - "source": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "uploadedTime": {
- "max": 0,
- "min": 0
}, - "sourceCreatedTime": {
- "max": 0,
- "min": 0
}, - "sourceModifiedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix",
- "uploaded": true,
- "labels": {
- "containsAny": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "relation": "INTERSECTS",
- "shape": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}
}
}, - "search": {
- "name": "string"
}
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Deletes the files with the given ids.
A maximum of 1000 files can be deleted per request.
project required | string Example: publicdata The project name. |
List of IDs of files to delete.
Array of FileInternalId (object) or FileExternalId (object) (FileIdEither) [ 1 .. 1000 ] items |
{- "items": [
- {
- "id": 1
}
]
}
{ }
Retrieves a list of download URLs for the specified list of file IDs. After getting the download links, the client has to issue a GET request to the returned URLs, which will respond with the contents of the file. The links will by default expire after 30 seconds. If providing the query parameter extendedExpiration the links will expire after 1 hour.
project required | string Example: publicdata The project name. |
extendedExpiration | boolean Default: false if set to true, will extend the expiration period of the link to 1 hour. |
List of file IDs to retrieve the download URL for.
Array of FileInternalId (object) or FileExternalId (object) (FileIdEither) [ 1 .. 100 ] items |
{- "items": [
- {
- "id": 1
}
]
}
{- "items": [
- {
- "downloadUrl": "string",
- "id": 1
}
]
}
The GET /files/icon operation can be used to get an image representation of a file.
Either id or externalId must be provided as a query parameter (but not both). Supported file formats:
project required | string Example: publicdata The project name. |
id | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
externalId | string (CogniteExternalId) <= 255 characters Example: externalId=my.known.id The external ID provided by the client. Must be unique for the resource type. |
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}
Updates the information for the files specified in the request body.
If you want to update the file content, uploaded using the uploadUrl, please use the initFileUpload request with the query parameter 'overwrite=true'. Alternatively, delete and recreate the file.
For primitive fields (String, Long, Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.
For the Json Array field (e.g. assetIds and securityCategories): Use either only 'set', or a combination of 'add' and/or 'remove'.
AssetIds update examples:
Example request body to overwrite assetIds with a new set, asset ID 1 and 2.
{
"items": [
{
"id": 1,
"update": {
"assetIds" : {
"set" : [ 1, 2 ]
}
}
}
]
}
Example request body to add one asset Id, and remove another asset ID.
{
"items": [
{
"id": 1,
"update": {
"assetIds" : {
"add" : [ 3 ],
"remove": [ 2 ]
}
}
}
]
}
Metadata update examples:
Example request body to overwrite metadata with a new set.
{
"items": [
{
"id": 1,
"update": {
"metadata": {
"set": {
"key1": "value1",
"key2": "value2"
}
}
}
}
]
}
Example request body to add two key-value pairs and remove two other key-value pairs by key for the metadata field.
{
"items": [
{
"id": 1,
"update": {
"metadata": {
"add": {
"key3": "value3",
"key4": "value4"
},
"remove": [
"key1",
"key2"
]
}
}
}
]
}
project required | string Example: publicdata The project name. |
The JSON request body which specifies which files and fields to update.
required | Array of FileChangeUpdateById (object) or FileChangeUpdateByExternalId (object) (FileChangeUpdate) [ 1 .. 1000 ] items |
{- "items": [
- {
- "id": 1,
- "update": {
- "externalId": {
- "set": "string"
}, - "directory": {
- "set": "string"
}, - "source": {
- "set": "string"
}, - "mimeType": {
- "set": "string"
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}, - "assetIds": {
- "set": [
- 0
]
}, - "sourceCreatedTime": {
- "set": 0
}, - "sourceModifiedTime": {
- "set": 0
}, - "dataSetId": {
- "set": 0
}, - "securityCategories": {
- "set": [
- 0
]
}, - "labels": {
- "add": [
- {
- "externalId": "my.known.id"
}
], - "remove": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "set": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}
}
}
}
]
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "directory": "string",
- "source": "string",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "dataSetId": 1,
- "sourceCreatedTime": 0,
- "sourceModifiedTime": 0,
- "securityCategories": [
- 1
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1,
- "uploaded": true,
- "uploadedTime": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Calculate aggregates for files, based on optional filter specification. Returns the following aggregates: count
project required | string Example: publicdata The project name. |
Files aggregate request body
object |
{- "filter": {
- "name": "string",
- "directoryPrefix": "/my/known/directory",
- "mimeType": "image/jpeg",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "externalId1",
- "externalId2",
- "externalId3"
], - "rootAssetIds": [
- {
- "id": 123456789
}, - {
- "externalId": "system 99 external Id 1234"
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "assetSubtreeIds": [
- {
- "id": 123456789
}, - {
- "externalId": "system 99 external Id 1234"
}
], - "source": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "uploadedTime": {
- "max": 0,
- "min": 0
}, - "sourceCreatedTime": {
- "max": 0,
- "min": 0
}, - "sourceModifiedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix",
- "uploaded": true,
- "labels": {
- "containsAny": [
- {
- "externalId": "my.known.id"
}
]
}, - "geoLocation": {
- "relation": "INTERSECTS",
- "shape": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}
}
}
}
{- "items": [
- {
- "count": 0
}
]
}
A sequence stores a table with up to 400 columns indexed by row number. There can be at most 400 numeric columns and 200 string columns. Each of the columns has a pre-defined type which is a string, integer, or floating point number.
For example, a sequence can represent a curve, either with the dependent variable x as the row number and a single value column y, or can simply store (x,y) pair in the rows directly. Other potential applications include data logs in which the index is not time-based. To learn more about sequences, see the concept guide.
List sequences. Use nextCursor to paginate through the results.
project required | string Example: publicdata The project name. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
limit | integer [ 1 .. 1000 ] Default: 25 Limits the number of results to be returned. The maximum results returned by the server is 1000 even if you specify a higher limit. |
const sequences = await client.sequences.list({ filter: { name: 'sequence_name' } });
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
], - "nextCursor": "string"
}
Create one or more sequences.
project required | string Example: publicdata The project name. |
Sequence to be stored
required | Array of objects (PostSequenceDTO) [ 1 .. 1000 ] items |
{- "items": [
- {
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}
}
], - "dataSetId": 1
}
]
}
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
]
}
Retrieves a list of sequences matching the given criteria.
project required | string Example: publicdata The project name. |
Retrieves a list of sequences matching the given criteria.
object (SequenceFilter) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Return up to this many results per page. |
cursor | string |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "filter": {
- "name": "string",
- "externalIdPrefix": "my.known.prefix",
- "metadata": {
- "key1": "value1",
- "key2": "value2"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "rootAssetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetSubtreeIds": [
- {
- "id": 1234567890
}, - {
- "externalId": "externalId123"
}
], - "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "dataSetIds": [
- {
- "id": 1
}
]
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "partition": "1/10"
}
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
], - "nextCursor": "string"
}
Count the number of sequences that match the given filter
project required | string Example: publicdata The project name. |
Retrieves the count of sequences matching the given criteria.
object (SequenceFilter) |
{- "filter": {
- "name": "string",
- "externalIdPrefix": "my.known.prefix",
- "metadata": {
- "key1": "value1",
- "key2": "value2"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "rootAssetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetSubtreeIds": [
- {
- "id": 1234567890
}, - {
- "externalId": "externalId123"
}
], - "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "dataSetIds": [
- {
- "id": 1
}
]
}
}
{- "items": [
- {
- "count": 0
}
]
}
Retrieve one or more sequences by ID or external ID. The sequences are returned in the same order as in the request.
project required | string Example: publicdata The project name. |
Ids of the sequences
required | Array of Select by Id (object) or Select by ExternalId (object) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
]
}
Retrieves a list of sequences matching the given criteria. This operation does not support pagination.
project required | string Example: publicdata The project name. |
Retrieves a list of sequences matching the given criteria. This operation does not support pagination.
object (SequenceFilter) | |
object (SequenceSearch) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Return up to this many results. |
{- "filter": {
- "name": "string",
- "externalIdPrefix": "my.known.prefix",
- "metadata": {
- "key1": "value1",
- "key2": "value2"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "rootAssetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetSubtreeIds": [
- {
- "id": 1234567890
}, - {
- "externalId": "externalId123"
}
], - "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "dataSetIds": [
- {
- "id": 1
}
]
}, - "search": {
- "name": "string",
- "description": "string",
- "query": "string"
}, - "limit": 100
}
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
]
}
Update one or more sequences. Fields that are not included in the request, are not changed.
project required | string Example: publicdata The project name. |
Patch definition
required | Array of Select by Id (object) or Select by ExternalId (object) (SequencesUpdate) [ 1 .. 1000 ] items |
{- "items": [
- {
- "update": {
- "name": {
- "set": "string"
}, - "description": {
- "set": "string"
}, - "assetId": {
- "set": 0
}, - "externalId": {
- "set": "string"
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}, - "dataSetId": {
- "set": 0
}, - "columns": {
- "modify": [
- {
- "externalId": "my.known.id",
- "update": {
- "description": {
- "set": "string"
}, - "externalId": {
- "set": "string"
}, - "name": {
- "set": "string"
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}
}
}
], - "add": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}
}
], - "remove": [
- {
- "externalId": "my.known.id"
}
]
}
}, - "id": 1
}
]
}
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
]
}
Deletes the sequences with the specified IDs. If one or more of the sequences do not exist, ignoreUnknownIds controls what will happen: if it is true, the sequences that do exist will be deleted, and the request succeeds; if it is false or absent, nothing will be deleted, and the request fails.
project required | string Example: publicdata The project name. |
Ids of the sequences to delete
required | Array of Select by Id (object) or Select by ExternalId (object) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{ }
Inserts rows into a sequence. This overwrites data in rows and columns that exist.
project required | string Example: publicdata The project name. |
Data posted
required | Array of Select by Id (object) or Select by ExternalId (object) (SequencePostData) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "DL/DRILL412/20190103/T3",
- "columns": [
- "Depth",
- "DepthSource",
- "PowerSetting"
], - "rows": [
- {
- "rowNumber": 1,
- "values": [
- 23331.3,
- "s2",
- 61
]
}
]
}
]
}
{ }
Processes data requests, and returns the result. NB - This operation uses a dynamic limit on the number of rows returned based on the number and type of columns, use the provided cursor to paginate and retrieve all data.
project required | string Example: publicdata The project name. |
Description of data requested
start | integer <int64> Default: 0 Lowest row number included. |
end | integer <int64> Get rows up to, but excluding, this row number. Default - No limit |
limit | integer <int32> [ 1 .. 10000 ] Default: 100 Maximum number of rows returned in one request. Api might return less even if there is more data, but it will then provide a cursor for continuation. If there is more data beyond this limit, a cursor will be returned to simplify further fetching of data. |
cursor | string Cursor for pagination returned from a previous request. Apart from this cursor, the rest of the request object have be the same as for the original request. |
columns | Array of strings [ 1 .. 400 ] items Columns to be included. Specified as list of column externalIds. In case this filter is not set, all available columns will be returned. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
{- "start": 0,
- "end": 1,
- "limit": 1,
- "cursor": "string",
- "columns": [
- "string"
], - "id": 1
}
{- "id": 1112,
- "externalId": "DL/DRILL412/20190103/T3",
- "columns": [
- {
- "externalId": "Depth"
}, - {
- "externalId": "DepthSource"
}, - {
- "externalId": "PowerSetting"
}
], - "rows": [
- {
- "rowNumber": 1,
- "values": [
- 23331.3,
- "s2",
- 61
]
}
], - "nextCursor": "string"
}
Retrieves the last row (i.e the row with the highest row number) in a sequence.
project required | string Example: publicdata The project name. |
Description of data requested
columns | Array of strings [ 1 .. 400 ] items Columns to be included. Specified as list of column externalIds. In case this filter is not set, all available columns will be returned. |
before | integer <int64> >= 1 Get rows up to but not including this row number. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
{- "columns": [
- "string"
], - "before": 1,
- "id": 1
}
{- "id": 1112,
- "externalId": "DL/DRILL412/20190103/T3",
- "columns": [
- {
- "externalId": "Depth"
}, - {
- "externalId": "DepthSource"
}, - {
- "externalId": "PowerSetting"
}
], - "rows": [
- {
- "rowNumber": 1,
- "values": [
- 23331.3,
- "s2",
- 61
]
}
]
}
Deletes the given rows of the sequence. All columns are affected.
project required | string Example: publicdata The project name. |
Indicate the sequences and the rows where data should be deleted
required | Array of Select by Id (object) or Select by ExternalId (object) (SequenceDeleteDataRequest) [ 1 .. 1000 ] items |
{- "items": [
- {
- "rows": [
- 1
], - "id": 1
}
]
}
{ }
The Geospatial API allows to model a problem domain when data has a geometric or geographic nature. The geospatial data is organized in feature types that are homogeneous collections of features (geospatial items), each having the same spatial representation, such as points, lines, or polygons, and a common set of typed properties. The Geospatial API is aware of Coordinate Reference Systems, and allows transformations. To learn more about geospatial concepts, see the concept guide.
List the defined Coordinate Reference Systems. The list can be limited to the custom Coordinate Reference Systems defined for the tenant.
project required | string Example: publicdata The project name. |
filterOnlyCustom | boolean Example: filterOnlyCustom=true Optional parameter to only list custom Coordinate Reference Systems. Defaults to false. |
{- "items": [
- {
- "srid": 4326,
- "wkt": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]",
- "projString": "+proj=longlat +datum=WGS84 +no_defs \"\"",
- "createdTime": 1633596134000,
- "lastUpdatedTime": 1633596134000
}
]
}
Creates custom Coordinate Reference Systems.
project required | string Example: publicdata The project name. |
List of custom Coordinate Reference Systems to be created.
required | Array of objects (GeospatialCoordinateReferenceSystem) |
{- "items": [
- {
- "srid": 456789,
- "wkt": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]",
- "projString": "+proj=longlat +datum=WGS84 +no_defs \"\""
}
]
}
{- "items": [
- {
- "srid": 4326,
- "wkt": "POINT (0 0)",
- "projString": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Get Coordinate Reference Systems by their Spatial Reference IDs
project required | string Example: publicdata The project name. |
required | Array of objects [ 1 .. 1000 ] items |
{- "items": [
- {
- "srid": 4326
}
]
}
{- "items": [
- {
- "srid": 4326,
- "wkt": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]",
- "projString": "+proj=longlat +datum=WGS84 +no_defs \"\"",
- "createdTime": 1633596134000,
- "lastUpdatedTime": 1633596134000
}
]
}
Delete custom Coordinate Reference Systems.
project required | string Example: publicdata The project name. |
List of custom Coordinate Reference Systems to be deleted.
required | Array of objects [ 1 .. 1000 ] items |
{- "items": [
- {
- "srid": 4326
}
]
}
{ }
Creates feature types. Each tenant can have up to 100 feature types.
project required | string Example: publicdata The project name. |
List of feature types to be created. It is possible to create up to 100 feature types in one request provided the total number of feature types on the tenant will not exceed 100.
required | Array of objects (GeospatialFeatureTypeSpec) [ 1 .. 100 ] items |
{- "items": [
- {
- "externalId": "ocean_temperature",
- "properties": {
- "temperature": {
- "type": "DOUBLE"
}, - "location": {
- "type": "POINT",
- "srid": 4326
}
}, - "searchSpec": {
- "location_idx": {
- "properties": [
- "location"
]
}
}
}
]
}
{- "items": [
- {
- "externalId": "ocean_temperature",
- "dataSetId": 1278028,
- "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505,
- "properties": {
- "temperature": {
- "type": "DOUBLE"
}, - "location": {
- "type": "POINT",
- "srid": 4326
}, - "createdTime": {
- "type": "LONG"
}, - "lastUpdatedTime": {
- "type": "LONG"
}, - "externalId": {
- "type": "STRING",
- "size": 32
}
}, - "searchSpec": {
- "location_idx": {
- "properties": [
- "location"
]
}, - "createdTimeIdx": {
- "properties": [
- "createdTime"
]
}, - "lastUpdatedTimeIdx": {
- "properties": [
- "lastUpdatedTime"
]
}, - "externalIdIdx": {
- "properties": [
- "externalId"
]
}
}
}
]
}
Retrieves feature types by external ids. It is possible to retrieve up to 100 items per request, i.e. the maximum number of feature types for a tenant.
project required | string Example: publicdata The project name. |
required | Array of objects [ 1 .. 100 ] items |
{- "items": [
- {
- "externalId": "ocean_temperature"
}
]
}
{- "items": [
- {
- "externalId": "ocean_temperature",
- "dataSetId": 1278028,
- "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505,
- "properties": {
- "temperature": {
- "type": "DOUBLE"
}, - "location": {
- "type": "POINT",
- "srid": 4326
}, - "createdTime": {
- "type": "LONG"
}, - "lastUpdatedTime": {
- "type": "LONG"
}, - "externalId": {
- "type": "STRING",
- "size": 32
}
}, - "searchSpec": {
- "location_idx": {
- "properties": [
- "location"
]
}, - "createdTimeIdx": {
- "properties": [
- "createdTime"
]
}, - "lastUpdatedTimeIdx": {
- "properties": [
- "lastUpdatedTime"
]
}, - "externalIdIdx": {
- "properties": [
- "externalId"
]
}
}
}
]
}
List all feature types
project required | string Example: publicdata The project name. |
{- "items": [
- {
- "externalId": "ocean_temperature",
- "dataSetId": 1278028,
- "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505,
- "properties": {
- "temperature": {
- "type": "DOUBLE"
}, - "location": {
- "type": "POINT",
- "srid": 4326
}, - "createdTime": {
- "type": "LONG"
}, - "lastUpdatedTime": {
- "type": "LONG"
}, - "externalId": {
- "type": "STRING",
- "size": 32
}
}, - "searchSpec": {
- "location_idx": {
- "properties": [
- "location"
]
}, - "createdTimeIdx": {
- "properties": [
- "createdTime"
]
}, - "lastUpdatedTimeIdx": {
- "properties": [
- "lastUpdatedTime"
]
}, - "externalIdIdx": {
- "properties": [
- "externalId"
]
}
}
}
]
}
Update one or more feature types
project required | string Example: publicdata The project name. |
List of feature types to be updated. It is possible to add and remove properties and indexes. WARNING: removing properties will result in data loss in corresponding features.
required | Array of objects (GeospatialUpdateFeatureTypeSpec) [ 1 .. 100 ] items |
{- "items": [
- {
- "externalId": "ocean_temperature",
- "update": {
- "properties": {
- "add": {
- "depth": {
- "type": "DOUBLE"
}
}
}, - "searchSpec": {
- "add": {
- "depth_idx": {
- "properties": [
- "depth"
]
}
}
}
}
}
]
}
{- "items": [
- {
- "externalId": "ocean_temperature",
- "dataSetId": 1278028,
- "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505,
- "properties": {
- "temperature": {
- "type": "DOUBLE"
}, - "location": {
- "type": "POINT",
- "srid": 4326
}, - "createdTime": {
- "type": "LONG"
}, - "lastUpdatedTime": {
- "type": "LONG"
}, - "externalId": {
- "type": "STRING",
- "size": 32
}
}, - "searchSpec": {
- "location_idx": {
- "properties": [
- "location"
]
}, - "createdTimeIdx": {
- "properties": [
- "createdTime"
]
}, - "lastUpdatedTimeIdx": {
- "properties": [
- "lastUpdatedTime"
]
}, - "externalIdIdx": {
- "properties": [
- "externalId"
]
}
}
}
]
}
Delete feature types.
project required | string Example: publicdata The project name. |
List of feature types to be deleted. It is possible to delete a maximum of 10 feature types per request. Feature types must not have related features. Feature types with related features can be deleted using force flag.
recursive | boolean (GeospatialRecursiveDelete) Indicates if feature types should be deleted together with all related features. Optional parameter, defaults to false. |
required | Array of objects [ 1 .. 10 ] items |
{- "items": [
- {
- "externalId": "ocean_temperature"
}
]
}
{ }
Create features
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
allowCrsTransformation | boolean (GeospatialAllowCrsTransformation) Optional parameter indicating if input geometry properties should be transformed into the respective Coordinate Reference Systems defined in the feature type specification. If the parameter is true, then input geometries will be transformed when the input and output Coordinate Reference Systems differ. When it is false, then requests with geometries in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. Transformations apply to property geometries in case of create and update feature, as well as to geometries in spatial filters in search endpoints. |
required | Array of objects (GeospatialFeatureSpec) [ 1 .. 1000 ] items [ items <= 200 properties ] |
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}
}
]
}
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}
]
}
Get features with paging support
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
limit | integer (SearchLimit) [ 1 .. 1000 ] Default: 1000 Limits the number of results to be returned. |
allowCrsTransformation | boolean (GeospatialAllowCrsTransformation) Example: allowCrsTransformation=true Optional parameter indicating if input geometry properties should be transformed into the respective Coordinate Reference Systems defined in the feature type specification. If the parameter is true, then input geometries will be transformed when the input and output Coordinate Reference Systems differ. When it is false, then requests with geometries in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. Transformations apply to property geometries in case of create and update feature, as well as to geometries in spatial filters in search endpoints. |
allowDimensionalityMismatch | boolean (GeospatialAllowDimensionalityMismatch) Example: allowDimensionalityMismatch=true Optional parameter indicating if the spatial filter operators allow input geometries with a different dimensionality than the properties they are applied to. For instance, when set to true, if a feature type has a property of type POLYGONZM (4D), its features can be filtered using the |
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}
], - "nextCursor": "pwGTFXeL-JiWO8CZpgP23g"
}
List features based on the feature property filter passed in the body of the request. This operation supports pagination by cursor.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
allowCrsTransformation | boolean (GeospatialAllowCrsTransformation) Optional parameter indicating if input geometry properties should be transformed into the respective Coordinate Reference Systems defined in the feature type specification. If the parameter is true, then input geometries will be transformed when the input and output Coordinate Reference Systems differ. When it is false, then requests with geometries in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. Transformations apply to property geometries in case of create and update feature, as well as to geometries in spatial filters in search endpoints. |
allowDimensionalityMismatch | boolean (GeospatialAllowDimensionalityMismatch) Optional parameter indicating if the spatial filter operators allow input geometries with a different dimensionality than the properties they are applied to. For instance, when set to true, if a feature type has a property of type POLYGONZM (4D), its features can be filtered using the |
GeospatialFeatureNotFilter (object) or GeospatialFeatureAndFilter (object) or GeospatialFeatureOrFilter (object) or GeospatialFeatureEqualsFilter (object) or GeospatialFeatureMissingFilter (object) or GeospatialFeatureLikeFilter (object) or GeospatialFeatureRegexFilter (object) or GeospatialFeatureRangeFilter (object) or GeospatialFeatureContainsAnyFilter (object) or GeospatialFeatureInFilter (object) or GeospatialFeatureStIntersectsFilter (object) or GeospatialFeatureStIntersects3dFilter (object) or GeospatialFeatureStWithinFilter (object) or GeospatialFeatureStWithinProperlyFilter (object) or GeospatialFeatureStContainsFilter (object) or GeospatialFeatureStContainsProperlyFilter (object) or GeospatialFeatureStWithinDistanceFilter (object) or GeospatialFeatureStWithinDistance3dFilter (object) (GeospatialFeatureFilter) | |
limit | integer (SearchLimit) [ 1 .. 1000 ] Default: 1000 Limits the number of results to be returned. |
object (GeospatialOutput) Desired output specification. | |
cursor | string |
{- "filter": {
- "and": [
- {
- "range": {
- "property": "temperature",
- "gt": 4.54
}
}, - {
- "stWithin": {
- "property": "location",
- "value": {
- "wkt": "POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))"
}
}
}
]
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}
], - "nextCursor": "pwGTFXeL-JiWO8CZpgP23g"
}
Retrieves features by external ids. It is possible to retrieve up to 1000 items per request.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
required | Array of objects (GeospatialItemExternalId) [ 1 .. 1000 ] items |
object (GeospatialOutput) Desired output specification. |
{- "items": [
- {
- "externalId": "measurement_point_765"
}, - {
- "externalId": "measurement_point_863"
}
]
}
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}
]
}
Update features. This is a replace operation, i.e., all feature properties have to be sent in the request body even if their values do not change.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
List of features to update.
allowCrsTransformation | boolean (GeospatialAllowCrsTransformation) Optional parameter indicating if input geometry properties should be transformed into the respective Coordinate Reference Systems defined in the feature type specification. If the parameter is true, then input geometries will be transformed when the input and output Coordinate Reference Systems differ. When it is false, then requests with geometries in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. Transformations apply to property geometries in case of create and update feature, as well as to geometries in spatial filters in search endpoints. |
required | Array of objects (GeospatialFeatureSpec) [ 1 .. 1000 ] items [ items <= 200 properties ] |
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}
}
]
}
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}
]
}
Delete features.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
List of features to be deleted. It is possible to post a maximum of 1000 items per request.
required | Array of objects (GeospatialItemExternalId) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "measurement_point_765"
}, - {
- "externalId": "measurement_point_863"
}
]
}
{ }
Search for features based on the feature property filter passed in the body of the request. The result of the search is limited to a maximum of 1000 items. Results in excess of the limit are truncated. This means that the complete result set of the search cannot be retrieved with this method. However, for a given unmodified feature collection, the result of the search is deterministic and does not change over time.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
allowCrsTransformation | boolean (GeospatialAllowCrsTransformation) Optional parameter indicating if input geometry properties should be transformed into the respective Coordinate Reference Systems defined in the feature type specification. If the parameter is true, then input geometries will be transformed when the input and output Coordinate Reference Systems differ. When it is false, then requests with geometries in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. Transformations apply to property geometries in case of create and update feature, as well as to geometries in spatial filters in search endpoints. |
allowDimensionalityMismatch | boolean (GeospatialAllowDimensionalityMismatch) Optional parameter indicating if the spatial filter operators allow input geometries with a different dimensionality than the properties they are applied to. For instance, when set to true, if a feature type has a property of type POLYGONZM (4D), its features can be filtered using the |
GeospatialFeatureNotFilter (object) or GeospatialFeatureAndFilter (object) or GeospatialFeatureOrFilter (object) or GeospatialFeatureEqualsFilter (object) or GeospatialFeatureMissingFilter (object) or GeospatialFeatureLikeFilter (object) or GeospatialFeatureRegexFilter (object) or GeospatialFeatureRangeFilter (object) or GeospatialFeatureContainsAnyFilter (object) or GeospatialFeatureInFilter (object) or GeospatialFeatureStIntersectsFilter (object) or GeospatialFeatureStIntersects3dFilter (object) or GeospatialFeatureStWithinFilter (object) or GeospatialFeatureStWithinProperlyFilter (object) or GeospatialFeatureStContainsFilter (object) or GeospatialFeatureStContainsProperlyFilter (object) or GeospatialFeatureStWithinDistanceFilter (object) or GeospatialFeatureStWithinDistance3dFilter (object) (GeospatialFeatureFilter) | |
limit | integer (SearchLimit) [ 1 .. 1000 ] Default: 1000 Limits the number of results to be returned. |
object (GeospatialOutput) Desired output specification. | |
sort | Array of strings Sort result by selected fields. Syntax: sort:["field_1","field_2:ASC","field_3:DESC"]. Default sort order is ascending if not specified. Available sort direction: ASC, DESC, ASC_NULLS_FIRST, DESC_NULLS_FIRST, ASC_NULLS_LAST, DESC_NULLS_LAST. |
{- "filter": {
- "and": [
- {
- "range": {
- "property": "temperature",
- "gt": 4.54
}
}, - {
- "stWithin": {
- "property": "location",
- "value": {
- "wkt": "POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))"
}
}
}
]
}, - "limit": 100,
- "sort": [
- "temperature:ASC",
- "location"
]
}
{- "items": [
- {
- "externalId": "measurement_point_765",
- "temperature": 5.65,
- "location": {
- "wkt": "POINT(60.547602 -5.423433)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}, - {
- "externalId": "measurement_point_863",
- "temperature": 5.03,
- "location": {
- "wkt": "POINT(60.585858 -6.474416)"
}, - "createdTime": 1629784673505,
- "lastUpdatedTime": 1629784673505
}
]
}
Search for features based on the feature property filter passed in the body of the request. The streaming response format can be length prefixed, new line delimited, record separator delimited or concatenated depending on requested output (see https://en.wikipedia.org/wiki/JSON_streaming).
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
allowCrsTransformation | boolean (GeospatialAllowCrsTransformation) Optional parameter indicating if input geometry properties should be transformed into the respective Coordinate Reference Systems defined in the feature type specification. If the parameter is true, then input geometries will be transformed when the input and output Coordinate Reference Systems differ. When it is false, then requests with geometries in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. Transformations apply to property geometries in case of create and update feature, as well as to geometries in spatial filters in search endpoints. |
allowDimensionalityMismatch | boolean (GeospatialAllowDimensionalityMismatch) Optional parameter indicating if the spatial filter operators allow input geometries with a different dimensionality than the properties they are applied to. For instance, when set to true, if a feature type has a property of type POLYGONZM (4D), its features can be filtered using the |
GeospatialFeatureNotFilter (object) or GeospatialFeatureAndFilter (object) or GeospatialFeatureOrFilter (object) or GeospatialFeatureEqualsFilter (object) or GeospatialFeatureMissingFilter (object) or GeospatialFeatureLikeFilter (object) or GeospatialFeatureRegexFilter (object) or GeospatialFeatureRangeFilter (object) or GeospatialFeatureContainsAnyFilter (object) or GeospatialFeatureInFilter (object) or GeospatialFeatureStIntersectsFilter (object) or GeospatialFeatureStIntersects3dFilter (object) or GeospatialFeatureStWithinFilter (object) or GeospatialFeatureStWithinProperlyFilter (object) or GeospatialFeatureStContainsFilter (object) or GeospatialFeatureStContainsProperlyFilter (object) or GeospatialFeatureStWithinDistanceFilter (object) or GeospatialFeatureStWithinDistance3dFilter (object) (GeospatialFeatureFilter) | |
limit | number |
object (GeospatialOutputStreaming) Desired output specification for streaming. |
{- "filter": {
- "and": [
- {
- "range": {
- "property": "temperature",
- "gt": 4.54
}
}, - {
- "stWithin": {
- "property": "location",
- "value": {
- "wkt": "POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))"
}
}
}
]
}, - "limit": 100,
- "output": {
- "jsonStreamFormat": "NEW_LINE_DELIMITED"
}
}
{- "property1": "string",
- "property2": "string",
- "externalId": "my.known.id",
- "createdTime": 0,
- "lastUpdatedTime": 0
}
Search for features based on the feature property filter and perform requested aggregations on a given property. Aggregations are supported for all filters that do not contain stWithin
, stWithinProperly
, stContains
and stContainsProperly
search in 3D geometries.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
allowDimensionalityMismatch | boolean (GeospatialAllowDimensionalityMismatch) Optional parameter indicating if the spatial filter operators allow input geometries with a different dimensionality than the properties they are applied to. For instance, when set to true, if a feature type has a property of type POLYGONZM (4D), its features can be filtered using the |
GeospatialFeatureNotFilter (object) or GeospatialFeatureAndFilter (object) or GeospatialFeatureOrFilter (object) or GeospatialFeatureEqualsFilter (object) or GeospatialFeatureMissingFilter (object) or GeospatialFeatureLikeFilter (object) or GeospatialFeatureRegexFilter (object) or GeospatialFeatureRangeFilter (object) or GeospatialFeatureContainsAnyFilter (object) or GeospatialFeatureInFilter (object) or GeospatialFeatureStIntersectsFilter (object) or GeospatialFeatureStIntersects3dFilter (object) or GeospatialFeatureStWithinFilter (object) or GeospatialFeatureStWithinProperlyFilter (object) or GeospatialFeatureStContainsFilter (object) or GeospatialFeatureStContainsProperlyFilter (object) or GeospatialFeatureStWithinDistanceFilter (object) or GeospatialFeatureStWithinDistance3dFilter (object) (GeospatialFeatureFilter) | |
aggregates | Array of strings Deprecated Items Enum: "avg" "count" "max" "min" "stCentroid" "stCollect" "stConvexHull" "stIntersection" "stUnion" "sum" "variance" This parameter is deprecated. Use |
property | string Deprecated This parameter is deprecated. Use |
outputSrid | integer (GeospatialReferenceId) [ 0 .. 1000000 ] EPSG code, e.g. 4326. Only valid for geometry types. See https://en.wikipedia.org/wiki/Spatial_reference_system |
groupBy | Array of strings names of properties to be used for grouping by |
sort | Array of strings Sort result by the selected fields (properties or aggregates). Default sort order is ascending if not specified. Available sort direction: ASC, DESC, ASC_NULLS_FIRST, DESC_NULLS_FIRST, ASC_NULLS_LAST, DESC_NULLS_LAST. |
object (GeospatialAggregateOutput) A list of aggregations which are requested. |
{- "filter": {
- "and": [
- {
- "range": {
- "property": "temperature",
- "gt": 4.54
}
}, - {
- "stWithin": {
- "property": "location",
- "value": {
- "wkt": "POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))"
}
}
}
]
}, - "groupBy": [
- "category"
], - "sort": [
- "average:ASC",
- "category:DESC"
], - "output": {
- "min_temperature": {
- "min": {
- "property": "temperature"
}
}, - "max_speed": {
- "max": {
- "property": "speed"
}
}
}
}
{- "items": [
- {
- "category": "first category",
- "max": 12.3,
- "min": 0.5,
- "average": 5.32
}, - {
- "category": "second category",
- "max": 14.3,
- "min": 0.7,
- "average": 8.32
}
]
}
Compute custom json output structures or well known binary format responses based on calculation or selection of feature properties or direct values given in the request.
project required | string Example: publicdata The project name. |
required | object |
{- "output": {
- "value": {
- "stTransform": {
- "geometry": {
- "ewkt": "SRID=4326;POLYGON((0 0,10 0,10 10,0 10,0 0))"
}, - "srid": 23031
}
}
}
}
{- "items": [
- {
- "value": {
- "wkt": "POLYGON((0 0,10.5 0,10.5 10.5,0 10.5,0 0))",
- "srid": 23031
}
}
]
}
Put a raster into a feature property. The feature property must be of type RASTER.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
featureExternalId required | string <= 256 characters ^[A-Za-z][A-Za-z0-9_]{0,255}$ Example: ocean_measure_W87H62 External Id of the type provided by client. Must be unique among all feature external ids within a CDF project and feature type. |
rasterPropertyName required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: bathymetry Raster Id of the raster property provided by client. Must be unique among all feature property names within a feature type. |
srid required | integer [ 1 .. 999999 ] Example: srid=3857 mandatory parameter that specifies the SRID of the coordinate reference system of a raster. |
format required | string Value: "XYZ" Example: format=XYZ mandatory parameter that specifies the format of the input raster. |
scaleX | number <double> Example: scaleX=2 optional parameter that specifies the pixel scale x in storage. If not specified, the pixel scale remains the same as the input raster. |
scaleY | number <double> Example: scaleY=2 optional parameter that specifies the pixel scale y in storage. If not specified, the pixel scale remains the same as the input raster. |
allowCrsTransformation | boolean Example: allowCrsTransformation=true Optional parameter indicating if the input raster coordinates should be transformed into the Coordinate Reference Systems defined for the raster property in the feature type specification. The transformation will typically impact the pixel values. When the parameter is false, requests with rasters in Coordinate Reference System different from the ones defined in the feature type will result in bad request response code. |
{- "srid": 3857,
- "width": 4,
- "height": 5,
- "numBands": 1,
- "scaleX": 1,
- "scaleY": 1,
- "skewX": 0,
- "skewY": 0,
- "upperLeftX": -0.5,
- "upperLeftY": -0.5
}
Get a raster from a feature property. The feature property must be of type RASTER.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
featureExternalId required | string <= 256 characters ^[A-Za-z][A-Za-z0-9_]{0,255}$ Example: ocean_measure_W87H62 External Id of the type provided by client. Must be unique among all feature external ids within a CDF project and feature type. |
rasterPropertyName required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: bathymetry Raster Id of the raster property provided by client. Must be unique among all feature property names within a feature type. |
srid | integer (GeospatialReferenceId) [ 0 .. 1000000 ] EPSG code, e.g. 4326. Only valid for geometry types. See https://en.wikipedia.org/wiki/Spatial_reference_system |
scaleX | number <double> |
scaleY | number <double> |
format required | string Value: "XYZ" |
object |
{- "srid": 4326,
- "scaleX": 0,
- "scaleY": 0,
- "format": "GTiff",
- "options": {
- "JPEG_QUALITY": 1
}
}
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
], - "invalid": [
- { }
], - "dependencies": [
- { }
]
}
}
Delete a raster from a feature property. If there is no raster already, the operation is a no-op.
project required | string Example: publicdata The project name. |
featureTypeExternalId required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: ocean_measures External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project. |
featureExternalId required | string <= 256 characters ^[A-Za-z][A-Za-z0-9_]{0,255}$ Example: ocean_measure_W87H62 External Id of the type provided by client. Must be unique among all feature external ids within a CDF project and feature type. |
rasterPropertyName required | string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$ Example: bathymetry Raster Id of the raster property provided by client. Must be unique among all feature property names within a feature type. |
{ }
Retrieves a list of all models in a project. This operation supports pagination. You can filter out all models without a published revision.
project required | string Example: publicdata The project name. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
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. |
published | boolean Filter based on whether or not it has published revisions. |
const models3D = await client.models3D.list({ published: true });
{- "items": [
- {
- "name": "My Model",
- "id": 1000,
- "createdTime": 0,
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
], - "nextCursor": "string"
}
project required | string Example: publicdata The project name. |
The models to create.
required | Array of objects (CreateModel3D) [ 1 .. 1000 ] items |
{- "items": [
- {
- "name": "My Model",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
]
}
{- "items": [
- {
- "name": "My Model",
- "id": 1000,
- "createdTime": 0,
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
]
}
project required | string Example: publicdata The project name. |
List of changes.
required | Array of objects (UpdateModel3D) [ 1 .. 1000 ] items |
{- "items": [
- {
- "id": 1,
- "update": {
- "name": {
- "set": "string"
}, - "dataSetId": {
- "set": 1
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}
}
}
]
}
{- "items": [
- {
- "name": "My Model",
- "id": 1000,
- "createdTime": 0,
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
]
}
project required | string Example: publicdata The project name. |
List of models to delete.
required | Array of objects (DataIdentifier) [ 1 .. 1000 ] items unique List of ID objects |
{- "items": [
- {
- "id": 1
}
]
}
{ }
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
await client.models3D.retrieve(3744350296805509);
{- "name": "My Model",
- "id": 1000,
- "createdTime": 0,
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
Retrieves a list of all revisions of a model. This operation supports pagination. You can also filter revisions if they are marked as published or not by using the query param published.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
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. |
published | boolean Filter based on published status. |
const revisions3D = await client.revisions3D.list(324566546546346);
{- "items": [
- {
- "id": 1000,
- "fileId": 1000,
- "published": false,
- "rotation": [
- 0,
- 0,
- 0
], - "camera": {
- "target": [
- 0,
- 0,
- 0
], - "position": [
- 0,
- 0,
- 0
]
}, - "status": "Done",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "thumbnailThreedFileId": 1000,
- "assetMappingCount": 0,
- "createdTime": 0
}
], - "nextCursor": "string"
}
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
The revisions to create.
required | Array of objects (CreateRevision3D) [ 1 .. 1000 ] items |
{- "items": [
- {
- "published": false,
- "rotation": [
- 0,
- 0,
- 0
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "camera": {
- "target": [
- 0,
- 0,
- 0
], - "position": [
- 0,
- 0,
- 0
]
}, - "fileId": 0
}
]
}
{- "items": [
- {
- "id": 1000,
- "fileId": 1000,
- "published": false,
- "rotation": [
- 0,
- 0,
- 0
], - "camera": {
- "target": [
- 0,
- 0,
- 0
], - "position": [
- 0,
- 0,
- 0
]
}, - "status": "Done",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "thumbnailThreedFileId": 1000,
- "assetMappingCount": 0,
- "createdTime": 0
}
]
}
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
List of changes.
required | Array of objects (UpdateRevision3D) [ 1 .. 1000 ] items |
{- "items": [
- {
- "id": 1,
- "update": {
- "published": {
- "set": true
}, - "rotation": {
- "set": [
- 0,
- 0,
- 0
]
}, - "camera": {
- "set": {
- "target": [
- 0,
- 0,
- 0
], - "position": [
- 0,
- 0,
- 0
]
}
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}
}
}
]
}
{- "items": [
- {
- "id": 1000,
- "fileId": 1000,
- "published": false,
- "rotation": [
- 0,
- 0,
- 0
], - "camera": {
- "target": [
- 0,
- 0,
- 0
], - "position": [
- 0,
- 0,
- 0
]
}, - "status": "Done",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "thumbnailThreedFileId": 1000,
- "assetMappingCount": 0,
- "createdTime": 0
}
]
}
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
List of revisions ids to delete.
required | Array of objects (DataIdentifier) [ 1 .. 1000 ] items unique List of ID objects |
{- "items": [
- {
- "id": 1
}
]
}
{ }
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
const revisions3D = await client.revisions3D.retrieve(8252999965991682, 4190022127342195)
{- "id": 1000,
- "fileId": 1000,
- "published": false,
- "rotation": [
- 0,
- 0,
- 0
], - "camera": {
- "target": [
- 0,
- 0,
- 0
], - "position": [
- 0,
- 0,
- 0
]
}, - "status": "Done",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "thumbnailThreedFileId": 1000,
- "assetMappingCount": 0,
- "createdTime": 0
}
List log entries for the revision
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
severity | integer <int64> Default: 5 Minimum severity to retrieve (3 = INFO, 5 = WARN, 7 = ERROR). |
{- "items": [
- {
- "timestamp": 0,
- "severity": 7,
- "type": "CONVERTER/FAILED",
- "info": "string"
}
]
}
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
The request body containing the file ID of the thumbnail image (from Files API).
fileId required | integer <int64> File ID of thumbnail file in Files API. Only JPEG and PNG files are supported. |
{- "fileId": 0
}
{ }
Retrieve a list of available outputs for a processed 3D model. An output can be a format that can be consumed by a viewer (e.g. Reveal) or import in external tools. Each of the outputs will have an associated version which is used to identify the version of output format (not the revision of the processed output). Note that the structure of the outputs will vary and is not covered here.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
format | string Format identifier, e.g. 'ept-pointcloud' (point cloud). Well known formats are: 'ept-pointcloud' (point cloud data) or 'reveal-directory' (output supported by Reveal). 'all-outputs' can be used to retrieve all outputs for a 3D revision. Note that some of the outputs are internal, where the format and availability might change without warning. |
{- "items": [
- {
- "format": "ept-pointcloud",
- "version": 1,
- "blobId": 1
}
]
}
Retrieves a list of nodes from the hierarchy in the 3D model. You can also request a specific subtree with the 'nodeId' query parameter and limit the depth of the resulting subtree with the 'depth' query parameter. By default, nodes are returned in order of ascending treeIndex. We suggest trying to set the query parameter sortByNodeId
to true
to check whether it makes your use case faster. The partition
parameter can only be used if sortByNodeId
is set to true
. This operation supports pagination.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
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. |
depth | integer <int32> Get sub nodes up to this many levels below the specified node. Depth 0 is the root node. |
nodeId | integer <int64> ID of a node that are the root of the subtree you request (default is the root node). |
sortByNodeId | boolean Default: false Enable sorting by nodeId. When this parameter is |
properties | string <jsonObject(jsonObject(string))> Example: Filter for node properties. Only nodes that match all the given properties exactly will be listed.
The filter must be a JSON object with the same format as the |
const nodes3d = await client.revisions3D.list3DNodes(8252999965991682, 4190022127342195);
{- "items": [
- {
- "id": 1000,
- "treeIndex": 3,
- "parentId": 2,
- "depth": 2,
- "name": "Node name",
- "subtreeSize": 4,
- "properties": {
- "category1": {
- "property1": "value1",
- "property2": "value2"
}, - "category2": {
- "property1": "value1",
- "property2": "value2"
}
}, - "boundingBox": {
- "max": [
- 0,
- 0,
- 0
], - "min": [
- 0,
- 0,
- 0
]
}
}
], - "nextCursor": "string"
}
List nodes in a project, filtered by node property values specified by supplied filters. This operation supports pagination and partitions.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
object (Node3DPropertyFilter) Filters used in the search. | |
limit | integer [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "filter": {
- "properties": {
- "PDMS": {
- "Area": [
- "AB76",
- "AB77",
- "AB78"
], - "Type": [
- "PIPE",
- "BEND",
- "PIPESUP"
]
}
}
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "partition": "1/10"
}
{- "items": [
- {
- "id": 1000,
- "treeIndex": 3,
- "parentId": 2,
- "depth": 2,
- "name": "Node name",
- "subtreeSize": 4,
- "properties": {
- "category1": {
- "property1": "value1",
- "property2": "value2"
}, - "category2": {
- "property1": "value1",
- "property2": "value2"
}
}, - "boundingBox": {
- "max": [
- 0,
- 0,
- 0
], - "min": [
- 0,
- 0,
- 0
]
}
}
], - "nextCursor": "string"
}
Retrieves specific nodes given by a list of IDs.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
The request body containing the IDs of the nodes to retrieve.
required | Array of objects (Node3DId) [ 1 .. 1000 ] items |
{- "items": [
- {
- "id": 1000
}
]
}
{- "items": [
- {
- "id": 1000,
- "treeIndex": 3,
- "parentId": 2,
- "depth": 2,
- "name": "Node name",
- "subtreeSize": 4,
- "properties": {
- "category1": {
- "property1": "value1",
- "property2": "value2"
}, - "category2": {
- "property1": "value1",
- "property2": "value2"
}
}, - "boundingBox": {
- "max": [
- 0,
- 0,
- 0
], - "min": [
- 0,
- 0,
- 0
]
}
}
]
}
Retrieves a list of ancestor nodes of a given node, including itself, in the hierarchy of the 3D model. This operation supports pagination.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
nodeId required | integer <int64> ID of the node to get the ancestors of. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
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. |
const nodes3d = await client.revisions3D.list3DNodeAncestors(8252999965991682, 4190022127342195, 572413075141081);
{- "items": [
- {
- "id": 1000,
- "treeIndex": 3,
- "parentId": 2,
- "depth": 2,
- "name": "Node name",
- "subtreeSize": 4,
- "properties": {
- "category1": {
- "property1": "value1",
- "property2": "value2"
}, - "category2": {
- "property1": "value1",
- "property2": "value2"
}
}, - "boundingBox": {
- "max": [
- 0,
- 0,
- 0
], - "min": [
- 0,
- 0,
- 0
]
}
}
], - "nextCursor": "string"
}
Retrieve the contents of a 3D file.
This endpoint supported tag-based caching.
This endpoint is only compatible with 3D file IDs from the 3D API, and not compatible with file IDs from the Files API.
project required | string Example: publicdata The project name. |
threedFileId required | integer <int64> The ID of the 3D file to retrieve. |
await client.files3D.retrieve(3744350296805509);
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}
List all asset mappings
Asset references obtained from a mapping - through asset ids - may be invalid, simply by the non-transactional nature of HTTP. They are NOT maintained by any means from CDF, meaning they will be stored until the reference is removed through the delete endpoint of 3d asset mappings.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
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. |
nodeId | integer <int64> |
assetId | integer <int64> |
intersectsBoundingBox | string Example: If given, only return asset mappings for assets whose bounding box intersects the given bounding box. Must be a JSON object with |
const mappings3D = await client.assetMappings3D.list(3244265346345, 32423454353545);
{- "items": [
- {
- "nodeId": 1003,
- "assetId": 3001,
- "treeIndex": 5,
- "subtreeSize": 7
}
], - "nextCursor": "string"
}
Create asset mappings
Asset references when creating a mapping - through asset ids - are allowed to be invalid. They are NOT maintained by any means from CDF, meaning they will be stored until the reference is removed through the delete endpoint of 3d asset mappings.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
The asset mappings to create.
required | Array of objects (CreateAssetMapping3D) [ 1 .. 1000 ] items |
{- "items": [
- {
- "nodeId": 1003,
- "assetId": 3001
}
]
}
{- "items": [
- {
- "nodeId": 1003,
- "assetId": 3001,
- "treeIndex": 5,
- "subtreeSize": 7
}
]
}
Delete a list of asset mappings
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
The IDs of the asset mappings to delete.
required | Array of objects (DeleteAssetMapping3D) [ 1 .. 1000 ] items |
{- "items": [
- {
- "nodeId": 1003,
- "assetId": 3001
}
]
}
{ }
Lists 3D assets mappings that match the specified filter parameter. Only
one type of filter can be specified for each request, either assetIds
, nodeIds
or treeIndexes
.
Asset references obtained from a mapping - through asset ids - may be invalid, simply by the non-transactional nature of HTTP. They are NOT maintained by any means from CDF, meaning they will be stored until the reference is removed through the delete endpoint of 3d asset mappings.
project required | string Example: publicdata The project name. |
modelId required | integer <int64> Model ID. |
revisionId required | integer <int64> Revision ID. |
The filter for asset mappings to get.
AssetMapping3DAssetFilter (object) or AssetMapping3DNodeFilter (object) or AssetMapping3DTreeIndexFilter (object) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
{- "filter": {
- "assetIds": [
- 0
]
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}
{- "items": [
- {
- "nodeId": 1003,
- "assetId": 3001,
- "treeIndex": 5,
- "subtreeSize": 7
}
], - "nextCursor": "string"
}
The entity matching contextualization endpoints lets you match CDF resources. For example, you can match time series to assets. The model uses similarity between string-fields from the source and the target to find potential matches, for instance the source name and the target name. The exact algorithm may change over time.
List all available entity matching models.
project required | string Example: publicdata The project name. |
limit | integer >= 1 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. |
{- "items": [
- {
- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
]
}
Note: All users on this CDF subscription with assets read-all and entitymatching read-all and write-all capabilities in the project, are able to access the data sent to this endpoint. Train a model that predicts matches between entities (for example, time series names to asset names). This is also known as fuzzy joining. If there are no trueMatches (labeled data), you train a static (unsupervised) model, otherwise a machine learned (supervised) model is trained.
project required | string Example: publicdata The project name. |
sources required | Array of objects (Sources) [ 0 .. 2000000 ] items List of custom source object to match from, for example, time series. String key -> value. Only string values are considered in the matching. Both |
targets required | Array of objects (Targets) [ 1 .. 2000000 ] items List of custom target object to match to, for example, assets. String key -> value. Only string values are considered in the matching. Both |
Array of objects or objects or objects or objects (TrueMatches) [ 1 .. 2000000 ] items [ items ] List of objects of pairs of sourceId or sourceExternalId and targetId or targetExternalId, that corresponds to entities in source and target respectively, that indicates a confirmed match used to train the model. If omitted, an unsupervised model is used. | |
externalId | string (CogniteExternalId) <= 255 characters The external ID provided by the client. Must be unique for the resource type. |
name | string (ModelName) <= 256 characters User defined name. |
description | string (ModelDescription) <= 500 characters User defined description. |
featureType | string Default: "simple" Enum: "simple" "insensitive" "bigram" "frequencyweightedbigram" "bigramextratokenizers" "bigramcombo" Each feature type defines one combination of features that will be created and used in the entity matcher model. All features are based on matching tokens. Tokens are defined at the top of the Entity matching section. The options are:
|
Array of objects (MatchFields) Default: [{"source":"name","target":"name"}] List of pairs of fields from the target and source items used to calculate features. All source and target items should have all the | |
classifier | string (Classifier) Default: "randomforest" Enum: "randomforest" "decisiontree" "logisticregression" "augmentedlogisticregression" "augmentedrandomforest" The classifier used in the model. Only relevant if there are trueMatches/labeled data and a supervised model is fitted. |
ignoreMissingFields | boolean (IgnoreMissingFields) Default: false If True, replaces missing fields in |
{- "sources": [
- {
- "id": 10,
- "name": "a_name",
- "field": "value",
- "ignoredfield": {
- "key": "value"
}
}
], - "targets": [
- {
- "id": 6,
- "name": "some_name",
- "somefield": "value",
- "ignoredfield": {
- "key": "value"
}
}
], - "trueMatches": [
- {
- "sourceId": 1,
- "targetId": 1
}, - {
- "sourceExternalId": "2",
- "targetExternalId": "2"
}
], - "externalId": "my.known.id",
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "classifier": "randomforest",
- "ignoreMissingFields": true
}
{- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
Shows the status of the model. If the status is completed, shows the parameters used to train the model.
project required | string Example: publicdata The project name. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
{- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
Retrieve entity matching models by IDs or external IDs.
project required | string Example: publicdata The project name. |
required | Array of objects or objects (OneOfId) List of ids or externalIds of models. |
{- "items": [
- {
- "id": 2563587950655335
}, - {
- "externalId": "myUniqueName"
}
]
}
{- "items": [
- {
- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
]
}
Use filtering options to find entity matcher models.
project required | string Example: publicdata The project name. |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 <- Limits the number of results to return. |
required | object Filter on models with strict matching. |
{- "limit": 100,
- "filter": {
- "featureType": "simple",
- "classifier": "randomforest",
- "originalId": 111,
- "name": "simple_model_1",
- "description": "Simple model 1"
}
}
{- "items": [
- {
- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
]
}
Update entity matching models by IDs or external IDs.
project required | string Example: publicdata The project name. |
required | Array of ModelChangeById (object) or ModelChangeByExternalId (object) (ModelChange) |
{- "items": [
- {
- "update": {
- "name": {
- "set": "simple_model_1"
}, - "description": {
- "set": "Simple model 1"
}
}, - "id": 1
}
]
}
{- "items": [
- {
- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
]
}
Deletes an entity matching model. Currently, this is a soft delete, and only removes the entry from listing.
project required | string Example: publicdata The project name. |
required | Array of objects or objects (OneOfId) List of ids or externalIds of models. |
{- "items": [
- {
- "id": 2563587950655335
}, - {
- "externalId": "myUniqueName"
}
]
}
{ }
Note: All users on this CDF subscription with assets read-all and entitymatching read-all and write-all capabilities in the project, are able to access the data sent to this endpoint. Predicts entity matches using a trained model.
project required | string Example: publicdata The project name. |
id required | integer <int64> [ 1 .. 9007199254740991 ] The ID of the model that is used to predict matches. |
sources | Array of objects [ 0 .. 2000000 ] items List of source entities to predict matches for, for example, time series. If omitted, will use |
targets | Array of objects [ 1 .. 2000000 ] items List of potential target entities to match to one or more of the source entities, for example, assets. If omitted, will use |
numMatches | integer [ 0 .. 100 ] The maximum number of results to return for each source entity. |
scoreThreshold | number [ 0 .. 1 ] Only return matches with score above this threshold. |
{- "externalId": "my.known.id",
- "sources": [
- {
- "id": 10,
- "name": "a_name",
- "field": "value",
- "ignoredfield": {
- "key": "value"
}
}
], - "targets": [
- {
- "id": 6,
- "name": "some_name",
- "somefield": "value",
- "ignoredfield": {
- "key": "value"
}
}
], - "numMatches": 3,
- "scoreThreshold": 0.7
}
{- "jobId": 123,
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0
}
Get the results from a predict job.
project required | string Example: publicdata The project name. |
jobId required | integer <int64> (JobId) Example: 123 Contextualization job ID. |
{- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "jobId": 123,
- "items": [
- {
- "source": {
- "field": "value",
- "ignoredfield": {
- "key": "value"
}
}, - "matches": [
- {
- "score": 0.98,
- "target": {
- "field": "value",
- "ignoredfield": {
- "key": "value"
}
}
}
]
}
]
}
Note: All users on this CDF subscription with assets read-all and entitymatching read-all and write-all capabilities in the project, are able to access the data sent to this endpoint. Creates a new model by re-training an existing model on existing data but with additional true matches. The old model is not changed. The new model gets a new id and new external id if newExternalId
is set, or no external id if newExternalId
is not set. Use for efficient re-training of the model after a user creates additional confirmed matches.
project required | string Example: publicdata The project name. |
id required | integer <int64> [ 1 .. 9007199254740991 ] The ID of the original model. |
newExternalId | string <= 255 characters ExternalId for the new refitted model provided by client. Must be unique within the project. |
required | Array of objects or objects or objects or objects [ 1 .. 2000000 ] items [ items ] List of additional confirmed matches used to train the model. The new model uses a combination of this and trueMatches from the orginal model. If there are identical match-from ids, the pair from the original model is dropped. |
sources | Array of objects [ 0 .. 2000000 ] items List of source entities, for example, time series. If omitted, will use data from fit. |
targets | Array of objects [ 1 .. 2000000 ] items List of target entities, for example, assets. If omitted, will use data from fit. |
{- "externalId": "my.known.id",
- "newExternalId": "my.known.id",
- "trueMatches": [
- {
- "sourceId": 1,
- "targetId": 1
}, - {
- "sourceExternalId": "2",
- "targetExternalId": "2"
}
], - "sources": [
- {
- "id": 10,
- "name": "a_name",
- "field": "value",
- "ignoredfield": {
- "key": "value"
}
}
], - "targets": [
- {
- "id": 6,
- "name": "some_name",
- "somefield": "value",
- "ignoredfield": {
- "key": "value"
}
}
]
}
{- "id": 1,
- "externalId": "my.known.id",
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "name": "simple_model_1",
- "description": "Simple model 1",
- "featureType": "simple",
- "matchFields": [
- {
- "source": "name",
- "target": "name"
}, - {
- "source": "field",
- "target": "somefield"
}
], - "ignoreMissingFields": true,
- "classifier": "randomforest",
- "originalId": 111
}
Detect annotations in engineering diagrams. Note: All users in a CDF project with assets read-all and files read-all capabilities can access data sent to this endpoint. Supported input file mime_types are application/pdf, image/jpeg, image/png, image/tiff.
project required | string Example: publicdata The project name. |
required | Array of objects or objects (OneOfFileId) [ 1 .. 50 ] items Files to run entity detection on. |
entities required | Array of objects (DiagramDetectEntities) [ 1 .. 500000 ] items [ items <= 256 properties ] A list of entities to look for. For example, all the assets under a root node. The |
searchField | string (DiagramSearchField) Default: "name" This field determines the string to search for and to identify object entities. |
partialMatch | boolean (DiagramPartialMatch) Default: false Allow partial (fuzzy) matching of entities in the engineering diagrams. Creates a match only when it is possible to do so unambiguously. |
minTokens | integer (DiagramMinTokens) Default: 2 Each detected item must match the detected entity on at least this number of tokens. A token is a substring of consecutive letters or digits. |
{- "items": [
- {
- "fileId": 1234
}
], - "entities": [
- {
- "userDefinedField": "21PT1017",
- "ignoredField": "AA11"
}, - {
- "userDefinedField": [
- "21PT1017-A",
- "21PT1017-B"
]
}
], - "searchField": "userDefinedField",
- "partialMatch": false,
- "minTokens": 2
}
{- "items": [
- {
- "fileId": 1234
}
], - "jobId": 123,
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "searchField": "userDefinedField",
- "partialMatch": false,
- "minTokens": 2
}
Get the results from an engineering diagram detect job.
project required | string Example: publicdata The project name. |
jobId required | integer <int64> (JobId) Example: 123 Contextualization job ID. |
{- "jobId": 123,
- "status": "Queued",
- "items": [
- {
- "fileId": 1234,
- "fileExternalId": "1234",
- "annotations": [
- {
- "text": "21-PT-1019",
- "confidence": 0.5,
- "region": {
- "shape": "rectangle",
- "vertices": [
- {
- "x": 0.58,
- "y": 0.12
}, - {
- "x": 0.58,
- "y": 0.12
}, - {
- "x": 0.58,
- "y": 0.12
}, - {
- "x": 0.58,
- "y": 0.12
}
], - "page": 1
}, - "entities": [
- {
- "userDefinedField": "21PT1017",
- "ignoredField": "AA11"
}, - {
- "userDefinedField": [
- "21PT1017-A",
- "21PT1017-B"
]
}
]
}
]
}
], - "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "searchField": "userDefinedField",
- "partialMatch": false,
- "minTokens": 2
}
Convert interactive engineering diagrams to image format, with highlighted annotations. Supported input file mime_types are application/pdf, image/jpeg, image/png, image/tiff. Supported output image formats are PNG and SVG, only the svg embeds the input annotations.
project required | string Example: publicdata The project name. |
required | Array of objects or objects (DiagramConvertRequestSchema) [ 1 .. 50 ] items An array of files and annotations to create interactive diagrams. |
grayscale | boolean (Grayscale) Default: true Return the SVG version in grayscale colors only (reduces the file size). |
{- "items": [
- {
- "fileId": 1234,
- "annotations": [
- {
- "text": "21-PT-1019",
- "confidence": 0.5,
- "region": {
- "shape": "rectangle",
- "vertices": [
- {
- "x": 0.58,
- "y": 0.12
}, - {
- "x": 0.58,
- "y": 0.12
}, - {
- "x": 0.58,
- "y": 0.12
}, - {
- "x": 0.58,
- "y": 0.12
}
], - "page": 1
}, - "entities": [
- {
- "userDefinedField": "21PT1017",
- "ignoredField": "AA11"
}, - {
- "userDefinedField": [
- "21PT1017-A",
- "21PT1017-B"
]
}
]
}
]
}
], - "grayscale": true
}
{- "items": [
- {
- "fileId": 1234
}
], - "jobId": 123,
- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "grayscale": true
}
Get the results for converting an engineering diagram to SVG and PNG formats.
project required | string Example: publicdata The project name. |
jobId required | integer <int64> (JobId) Example: 123 Contextualization job ID. |
{- "jobId": 123,
- "status": "Queued",
- "items": [
- {
- "fileId": 1234,
- "fileExternalId": "1234",
- "results": [
- {
- "page": 1,
}
]
}
], - "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "grayscale": true
}
The Vision contextualization endpoints enable extraction of information from imagery data based on their visual content. For example, you can detect external ID or name of assets, detect and read value of gauges or identify common industrial objects in images.
This service has support for batch processing which enables processing of multiple image files via an asynchronous prediction request. A new contextualization job is triggered by sending a POST request to the service. The response of the POST request contains a job ID, which can then be used to make subsequent calls to check the status and retrieve the results of the job once it is completed.
Start an asynchronous prediction job for extracting features such as text, asset tags or industrial objects from images. The response of the POST request contains a job ID, which can be used to make subsequent (GET) calls to check the status and retrieve the results of the job (see Retrieve results from a feature extraction job).
It is possible to have up to 20 concurrent jobs per CDF project.
The files referenced by items
in the request body must fulfill the following requirements:
.jpeg
, .jpg
or .png
image/png
or image/jpeg
as mimeType
New feature extractors may be added in the future.
project required | string Example: publicdata The project name. |
cdf-version | string Example: alpha cdf version header. Use this to specify the requested CDF release. |
A request for running an extract job.
required | Array of objects or objects (FileReference) [ 1 .. 100 ] List of image files to be analyzed by the feature extractors. |
required | Array of TextDetection (string) or AssetTagDetection (string) or PeopleDetection (string) or IndustrialObjectDetection (string) or PersonalProtectiveEquipmentDetection (string) (VisionExtractFeature) unique The type of detections to perform. New feature extractors may appear. |
object (FeatureParameters) Feature-specific parameters. New feature extractor parameters may appear. |
{- "items": [
- {
- "fileId": 1234
}
], - "features": [
- "TextDetection",
- "AssetTagDetection",
- "PeopleDetection"
], - "parameters": {
- "textDetectionParameters": {
- "threshold": 0.8
}, - "assetTagDetectionParameters": {
- "threshold": 0.8,
- "partialMatch": true,
- "assetSubtreeIds": [
- 1,
- 2
]
}, - "peopleDetectionParameters": {
- "threshold": 0.8
}
}
}
{- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "jobId": 123,
- "items": [
- {
- "fileId": 1234,
- "fileExternalId": "1234"
}
], - "features": [
- "TextDetection",
- "AssetTagDetection",
- "PeopleDetection"
], - "parameters": {
- "textDetectionParameters": {
- "threshold": 0.8
}, - "assetTagDetectionParameters": {
- "threshold": 0.8,
- "partialMatch": true,
- "assetSubtreeIds": [
- 1,
- 2
]
}, - "peopleDetectionParameters": {
- "threshold": 0.8
}
}
}
Retrieve results from a feature extraction job on images.
Note that since files are split up into batches and processed independently of each other, the items in successfully completed batches will be returned even if files in other batches are still being processed. The job status will be Running
until all batches have been processed. If one of the items in a batch fails, the results from items in other completed batches will still be returned. The corresponding items and error message(s) of failed batches will be populated in failedItems
.
Additionally, the status of the job is set to Completed
if at least one batch is successfully completed, otherwise the status is set to Failed
.
project required | string Example: publicdata The project name. |
jobId required | integer <int64> (JobId) Example: 123 Contextualization job ID. |
cdf-version | string Example: alpha cdf version header. Use this to specify the requested CDF release. |
// get an existing job, wait for it to complete, and get the results const { items } = await client.vision.getExtractJob(1, true); items.forEach((item) => { const predictions = item.predictions; // do something with the predictions })
{- "status": "Queued",
- "createdTime": 0,
- "startTime": 0,
- "statusTime": 0,
- "jobId": 123,
- "items": [
- {
- "fileId": 1234,
- "fileExternalId": "1234",
- "predictions": {
- "textPredictions": [
- {
- "confidence": 0.9,
- "text": "string",
- "textRegion": {
- "xMin": 0.5,
- "xMax": 0.9,
- "yMin": 0.5,
- "yMax": 0.9
}
}
], - "assetTagPredictions": [
- {
- "confidence": 0.9,
- "assetRef": {
- "id": 1233
}, - "text": "string",
- "textRegion": {
- "xMin": 0.5,
- "xMax": 0.9,
- "yMin": 0.5,
- "yMax": 0.9
}
}
], - "peoplePredictions"": [
- {
- "label": "person",
- "confidence": 0.8,
- "boundingBox": {
- "xMin": 0.5,
- "xMax": 0.9,
- "yMin": 0.5,
- "yMax": 0.9
}
}
]
}
}
], - "failedItems": [
- {
- "errorMessage": "string",
- "items": [
- {
- "fileId": 1234,
- "fileExternalId": "1234"
}
]
}
], - "parameters": {
- "textDetectionParameters": {
- "threshold": 0.8
}, - "assetTagDetectionParameters": {
- "threshold": 0.8,
- "partialMatch": true,
- "assetSubtreeIds": [
- 1,
- 2
]
}, - "peopleDetectionParameters": {
- "threshold": 0.8
}
}
}
A document is a file that has been indexed by the document search engine. Every time a file is uploaded, updated or deleted in the Files API, it will also be scheduled for processing by the document search engine. After some processing, it will be possible to search for the file in the document search API.
The document search engine is able to extract content from a variety of document
types, and perform classification, contextualization and other operations on the
file. This extracted and derived information is made available in the form of a
Document
object.
The document structure consists of a selection of derived fields, such as the
title
, author
and language
of the document, plus some of the original fields
from the raw file. The fields from the raw file can be found in the
sourceFile
structure.
Documents can be created from the following types of files:
This endpoint lets you search for documents by using advanced filters and free text queries. Free text queries are matched against the documents' filenames and contents.
The +
symbol signifies an AND operation, and the |
symbol signifies an OR.
Searching for lorem + ipsum
will match documents containing both "lorem" AND "ipsum" in the filename or content.
Similarly, searching for lorem | ipsum
will match documents containing either "lorem" OR "ipsum" in the filename or content.
The default operator between the search keywords is AND.
That means that searching for two terms without any operator, like so: lorem ipsum
, will
match documents containing both the words "lorem" and "ipsum" in the filename or content.
To exclude documents containing a specific word, you can use the operator -
.
For instance, the search lorem -ipsum
will match documents that contain the word "lorem", but does NOT contain the word "ipsum".
Enclose multiple words inside double quotes "
to group these words together.
Normally, the search query lorem ipsum
will match not only "lorem ipsum" but also "lorem cognite ipsum",
and in general there can be any number of words between the two words in the query.
The search query "lorem ipsum"
, however, will match only exactly "lorem ipsum" and not "lorem cognite ipsum".
To search for the special characters (+
, |
, -
, "
. \
), escape with a preceding backslash ().
When you search for a term, we try to return the most relevant documents first, and less relevant documents further down the list. There are a few factors that determine the relevance of a document:
{
"search": {
"query": "cognite \"lorem ipsum\""
}
}
This request will return documents matching the search query, where the query behaves as described above.
{
"search": {
"query": "cognite \"lorem ipsum\""
},
"filter": {
"prefix": {
"property": ["externalId"],
"value": "1"
}
}
}
This example combines a query with a filter.
This search request will return documents matching the search query, and where externalId
starts with "1".
The results will be ordered by how well they match the query string.
Filtering is done by using a special JSON filtering language.
It is quite flexible and consists of a number of different "leaf" filters which can be combined
together arbitrarily using the boolean clauses and
, or
and not
.
The available leaf filters are: equals
, in
, containsAny
, containsAll
, range
, prefix
, exists
, geojsonIntersects
, geojsonDisjoint
and geojsonWithin
.
Below is an overview of all the properties that can be filtered on, and which filters are applicable to each property.
Property | Type | Applicable filters |
---|---|---|
["id"] |
integer | equals, in, range, exists |
["externalId"] |
string | equals, in, prefix, exists |
["title"] |
string | equals, in, prefix, exists |
["author"] |
string | equals, in, prefix, exists |
["createdTime"] |
integer | equals, in, range, exists |
["modifiedTime"] |
integer | equals, in, range, exists |
["lastIndexedTime"] |
integer | equals, in, range, exists |
["mimeType"] |
string | equals, in, prefix, exists |
["extension"] |
string | equals, in, prefix, exists |
["pageCount"] |
integer | equals, in, range, exists |
["type"] |
string | equals, in, prefix, exists |
["geoLocation"] |
geometry object | geojsonIntersects, geojsonDisjoint, geojsonWithin, exists |
["language"] |
string | equals, in, prefix, exists |
["assetIds"] |
array of integers | containsAny, containsAll, exists |
["assetExternalIds"] |
array of strings | containsAny, containsAll, exists |
["labels"] |
array of Labels | containsAny, containsAll, exists |
["sourceFile", "name"] |
string | equals, in, prefix, exists |
["sourceFile", "mimeType"] |
string | equals, in, prefix, exists |
["sourceFile", "size"] |
integer | equals, in, range, exists |
["sourceFile", "source"] |
string | equals, in, prefix, exists |
["sourceFile", "directory"] |
string | equals, in, prefix, exists |
["sourceFile", "assetIds"] |
array of integers | containsAny, containsAll, exists |
["sourceFile", "assetExternalIds"] |
array of strings | containsAny, containsAll, exists |
["sourceFile", "datasetId"] |
integer | equals, in, range, exists |
["sourceFile", "securityCategories"] |
array of integers | containsAny, containsAll, exists |
["sourceFile", "geoLocation"] |
geometry object | geojsonIntersects, geojsonDisjoint, geojsonWithin, exists |
["sourceFile", "labels"] |
array of Labels | containsAny, containsAll, exists |
["sourceFile", "metadata", *] |
string | equals, in, prefix, exists |
All filtering is done in a case-sensitive manner against the resource data.
Note that some properties holds normalized data. E.g. a document with source file name
FILE.PDF
will have the extension
property be pdf
. A filter for extension equals
to PDF
will not match this document, as it must be specified as pdf
.
{
"filter": {
"and": [
{
"or": [
{
"equals": {
"property": ["type"],
"value": "PDF"
}
},
{
"prefix": {
"property": ["externalId"],
"value": "hello"
}
}
]
},
{
"range": {
"property": ["createdTime"],
"lte": 1519862400000
}
},
{
"not": {
"in": {
"property": ["sourceFile", "name"],
"values": ["My Document.doc", "My Other Document.docx"]
}
}
}
]
}
}
Aggregations can help provide useful information about your search results and about your whole data set. They can help answer questions such as "How many documents are there in total?" or "How many PDF documents matches my current query?"
The Documents API only supports one type of aggregation at the moment; the count
aggregation.
The count
aggregation can give you a count of how many documents exist for the different values of a given property.
If no property is given, the count
aggregation gives you the total count of documents.
More aggregation types may be added in the future.
When you enable highlights for your search query, the response contains an additional highlight field for each search hit that includes the highlighted fragments for your query matches. However, this is a costly operation and we therefore limit the results to 20 documents.
Below is an overview of all the properties that can be aggregated on, and which aggregate is applicable to each property.
Property | Applicable aggregation |
---|---|
["mimeType"] |
count |
["pageCount"] |
count |
["type"] |
count |
["extension"] |
count |
["author"] |
count |
["language"] |
count |
["sourceFile", "source"] |
count |
["sourceFile", "mimeType"] |
count |
["sourceFile", "labels"] |
count |
{
"aggregates": [
{
"name": "countPerType",
"aggregate": "count",
"groupBy": [
{
"property": ["type"]
}
]
}
]
}
Search results are by default ordered by relevance, meaning how well they match the given query string. However, it is possible to specify a different property to sort by. Sorting can be ascending or descending. The default sort order is ascending, in case none is specified.
Below is an overview of all the properties that can be sorted on.
Property |
---|
["id"] |
["externalId"] |
["mimeType"] |
["extension"] |
["pageCount"] |
["author"] |
["title"] |
["language"] |
["type"] |
["createdTime"] |
["modifiedTime"] |
["lastIndexedTime"] |
["sourceFile", "name"] |
["sourceFile", "mimeType"] |
["sourceFile", "size"] |
["sourceFile", "source"] |
["sourceFile", "datasetId"] |
{
"sort": [
{
"property": ["createdTime"],
"order": "asc",
}
]
}
project required | string Example: publicdata The project name. |
Fields to be set for the search request.
object | |
(bool filters (and (object) or or (object) or not (object))) or (leaf filters (equals (object) or in (object) or containsAny (object) or containsAll (object) or range (object) or prefix (object) or exists (object) or geojsonIntersects (object) or geojsonDisjoint (object) or geojsonWithin (object))) (DocumentFilter) A JSON based filtering language. See detailed documentation above. | |
Array of objects (DocumentSearchCountAggregate) [ 1 .. 5 ] items | |
Array of objects (DocumentSortItem) = 1 items List of properties to sort by. Currently only supports 1 property. | |
limit | integer <int32> [ 0 .. 1000 ] Default: 100 Maximum number of items. When using highlights the maximum value is reduced to 20. |
cursor | string Cursor for paging through results |
{- "search": {
- "query": "cognite \"lorem ipsum\"",
- "highlight": false
}, - "filter": {
- "and": [
- {
- "prefix": {
- "property": [
- "name"
], - "value": "Report"
}
}, - {
- "equals": {
- "property": [
- "type"
], - "value": "PDF"
}
}
]
}, - "aggregates": [
- {
- "name": "countOfTypes",
- "aggregate": "count",
- "groupBy": [
- {
- "property": [
- "type"
]
}
]
}
], - "sort": [
- {
- "order": "asc",
- "property": [
- "sourceFile",
- "name"
]
}
], - "limit": 100,
- "cursor": "string"
}
{- "items": [
- {
- "highlight": {
- "name": [
- "amet elit <em>non diam</em> aliquam suscipit"
], - "content": [
- "Nunc <em>vulputate erat</em> ipsum, at aliquet ligula vestibulum at",
- "<em>Quisque</em> lectus ex, fringilla aliquet <em>eleifend</em> nec, laoreet a velit.\n\nPhasellus <em>faucibus</em> risus arcu"
]
}, - "item": {
- "id": 2384,
- "externalId": "haml001",
- "title": "Hamlet",
- "author": "William Shakespeare",
- "createdTime": 1519862400000,
- "modifiedTime": 1519958703000,
- "lastIndexedTime": 1521062805000,
- "mimeType": "text/plain",
- "extension": "pdf",
- "pageCount": 2,
- "type": "Document",
- "language": "en",
- "truncatedContent": "ACT I\nSCENE I. Elsinore. A platform before the castle.\n FRANCISCO at his post. Enter to him BERNARDO\nBERNARDO\n Who's there?\n",
- "assetIds": [
- 42,
- 101
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "sourceFile": {
- "name": "hamlet.txt",
- "directory": "plays/shakespeare",
- "source": "SubsurfaceConnectors",
- "mimeType": "application/octet-stream",
- "size": 1000,
- "assetIds": [ ],
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Point",
- "coordinates": [
- 10.74609,
- 59.91273
]
}, - "datasetId": 1,
- "securityCategories": [ ],
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}, - "geoLocation": {
- "type": "Point",
- "coordinates": [
- 10.74609,
- 59.91273
]
}
}
}
], - "aggregates": [
- {
- "name": "string",
- "groups": [
- {
- "group": [
- {
- "property": [
- "sourceFile",
- "name"
], - "value": "string"
}
], - "count": 0
}
], - "total": 0
}
], - "nextCursor": "string"
}
The aggregation API allows you to compute aggregated results on documents like getting the count of all documents in a project or checking what are all the different authors of documents in a project, along with the count of documents in each of those aggregations. By specifying an additional filter or search, you can also aggregate only among documents matching the specified filter or search.
The default behavior, when you do not specify the aggregate
field in the request
body, is to return the count of all matched documents.
Setting aggregate
to uniqueValues
will return top unique values (up to the
requested limit) and the count of each in the property specified in
properties
. The list will have the highest count first. For example:
{
"aggregate": "uniqueValues",
"properties": [
{
"property": ["author"]
}
]
}
will return the top unique authors in the documents in your project. If the number of unique authors is less than the requested limit you will be receiving all unique authors ordered by the most frequent first.
Similarly,
{
"aggregate": "uniqueValues",
"properties": [
{
"property": ["author"]
}
],
"filter": {
"equals": {
"property": ["type"],
"value": "PDF"
}
}
}
will return top unique authors in PDF documents.
Setting aggregate
to allUniqueValues
will return all unique values
and the count of each. The response contains a cursor that must be used
to fetch all pages of data. The data is not ordered by the count. This
allows to retrieve all unique values for more than 10000 items.
project required | string Example: publicdata The project name. |
object | |
(bool filters (and (object) or or (object) or not (object))) or (leaf filters (equals (object) or in (object) or containsAny (object) or containsAll (object) or range (object) or prefix (object) or exists (object) or geojsonIntersects (object) or geojsonDisjoint (object) or geojsonWithin (object))) (DocumentFilter) A JSON based filtering language. See detailed documentation above. | |
aggregate | string Default: "count" Value: "count" |
{- "filter": {
- "equals": {
- "property": [
- "type"
], - "value": "PDF"
}
}, - "aggregate": "uniqueValues",
- "properties": [
- {
- "property": [
- "author"
]
}
]
}
{- "items": [
- {
- "count": 10
}
]
}
Retrieves a list of the documents in a project. You can use filters to narrow down the list. Unlike the search endpoint, the pagination is not restricted to 1000 documents in total, meaning this endpoint can be used to iterate through all the documents in your project.
For more information on how the filtering works, see the documentation for the search endpoint.
project required | string Example: publicdata The project name. |
Fields to be set for the list request.
(bool filters (and (object) or or (object) or not (object))) or (leaf filters (equals (object) or in (object) or containsAny (object) or containsAll (object) or range (object) or prefix (object) or exists (object) or geojsonIntersects (object) or geojsonDisjoint (object) or geojsonWithin (object))) (DocumentFilter) A JSON based filtering language. See detailed documentation above. | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Maximum number of items per page. Use the cursor to get more pages. |
cursor | string Cursor for paging through results |
{- "filter": {
- "and": [
- {
- "prefix": {
- "property": [
- "name"
], - "value": "Report"
}
}, - {
- "equals": {
- "property": [
- "type"
], - "value": "PDF"
}
}
]
}, - "limit": 100,
- "cursor": "string"
}
{- "items": [
- {
- "id": 2384,
- "externalId": "haml001",
- "title": "Hamlet",
- "author": "William Shakespeare",
- "createdTime": 1519862400000,
- "modifiedTime": 1519958703000,
- "lastIndexedTime": 1521062805000,
- "mimeType": "text/plain",
- "extension": "pdf",
- "pageCount": 2,
- "type": "Document",
- "language": "en",
- "truncatedContent": "ACT I\nSCENE I. Elsinore. A platform before the castle.\n FRANCISCO at his post. Enter to him BERNARDO\nBERNARDO\n Who's there?\n",
- "assetIds": [
- 42,
- 101
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "sourceFile": {
- "name": "hamlet.txt",
- "directory": "plays/shakespeare",
- "source": "SubsurfaceConnectors",
- "mimeType": "application/octet-stream",
- "size": 1000,
- "assetIds": [ ],
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Point",
- "coordinates": [
- 10.74609,
- 59.91273
]
}, - "datasetId": 1,
- "securityCategories": [ ],
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}, - "geoLocation": {
- "type": "Point",
- "coordinates": [
- 10.74609,
- 59.91273
]
}
}
], - "nextCursor": "string"
}
Returns extracted textual information for the given document.
The documents pipeline extracts up to 1MiB of textual information from each processed document. The search and list endpoints truncate the textual content of each document, in order to reduce the size of the returned payload. If you want the whole text for a document, you can use this endpoint.
The accept
request header MUST be set to text/plain
. Other values will
give an HTTP 406 error.
project required | string Example: publicdata The project name. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}
The document preview service is a utility API that can render most document types as an image or PDF. This can be very helpful if you want to display a preview of a file in a frontend, or for other tasks that require one of these formats.
For both rendered formats there is a concept of a page. The actual meaning of a page depends on the source document. E.g. an image will always have exactly one page, while a spreadsheet will typically have one page representing each individual sheet.
The document preview service can only generate preview for document sizes that do not exceed 150 MiB. Trying to preview a larger document will give an error.
Previews can be created for the following types of files:
cdf-version: beta
header is provided.)This endpoint returns a rendered image preview for a specific page of the specified document.
The accept
request header MUST be set to image/png
. Other values will
give an HTTP 406 error.
The rendered image will be downsampled to a maximum of 2400x2400 pixels. Only PNG format is supported and only the first 10 pages can be rendered.
Previews will be rendered if neccessary during the request. Be prepared for the request to take a few seconds to complete.
project required | string Example: publicdata The project name. |
documentId required | integer Internal ID for document to preview |
pageNumber required | integer [ 1 .. 10 ] Page number to preview. Starting at 1 for first page |
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}
This endpoint returns a rendered PDF preview for a specified document.
The accept
request header MUST be set to application/pdf
. Other values will
give an HTTP 406 error.
This endpoint is optimized for in-browser previews. We reserve the right to adjust the quality and other attributes of the output with this in mind. Please reach out to us if you have a different use case and requirements.
Only the 100 first pages will be included.
Previews will be rendered if neccessary during the request. Be prepared for the request to take a few seconds to complete.
project required | string Example: publicdata The project name. |
documentId required | integer Internal ID for document to preview |
cdf-version | string Example: alpha cdf version header. Use this to specify the requested CDF release. |
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}
This endpoint works similar as the normal preview endpoint except it returns a short-lived temporary link to download the rendered preview instead of returning the binary data.
project required | string Example: publicdata The project name. |
documentId required | integer Internal ID for document to preview |
cdf-version | string Example: alpha cdf version header. Use this to specify the requested CDF release. |
{- "temporaryLink": "string",
- "expirationTime": 1519862400000
}
Manage data in the raw NoSQL database. Each project will have a variable number of raw databases, each of which will have a variable number of tables, each of which will have a variable number of key-value objects. Only queries on key are supported through this API.
project required | string Example: publicdata The project name. |
limit | integer <int32> [ 1 .. 1000 ] Default: 25 Limit on the number of databases to be returned. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
const databases = await client.raw.listDatabases();
{- "items": [
- {
- "name": "string"
}
], - "nextCursor": "string"
}
Create databases in a project. It is possible to post a maximum of 1000 databases per request.
project required | string Example: publicdata The project name. |
List of names of databases to be created.
Array of objects (RawDB) |
{- "items": [
- {
- "name": "string"
}
]
}
{- "items": [
- {
- "name": "string"
}
]
}
It deletes a database, but fails if the database is not empty and recursive is set to false (default).
project required | string Example: publicdata The project name. |
List of names of the databases to be deleted.
Array of objects (RawDB) | |
recursive | boolean Default: false When true, tables of this database are deleted with the database. |
{- "items": [
- {
- "name": "string"
}
], - "recursive": false
}
{ }
project required | string Example: publicdata The project name. |
dbName required | string The name of a database to retrieve tables from. |
limit | integer <int32> [ 1 .. 1000 ] Default: 25 Limit on the number of tables to be returned. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
const tables = await client.raw.listTables('My company');
{- "items": [
- {
- "name": "string"
}
], - "nextCursor": "string"
}
Create tables in a database. It is possible to post a maximum of 1000 tables per request.
project required | string Example: publicdata The project name. |
dbName required | string Name of the database to create tables in. |
ensureParent | boolean Default: false Create database if it doesn't exist already |
List of tables to create.
Array of objects (RawDBTable) |
{- "items": [
- {
- "name": "string"
}
]
}
{- "items": [
- {
- "name": "string"
}
]
}
project required | string Example: publicdata The project name. |
dbName required | string Name of the database to delete tables in. |
List of tables to delete.
Array of objects (RawDBTable) |
{- "items": [
- {
- "name": "string"
}
]
}
{ }
Retrieve cursors based on the last updated time range. Normally this endpoint is used for reading in parallel.
Each cursor should be supplied as the 'cursor' query parameter on GET requests to Read Rows. Note that the 'minLastUpdatedTime' and the 'maxLastUpdatedTime' query parameter on Read Rows are ignored when a cursor is specified.
project required | string Example: publicdata The project name. |
dbName required | string Name of the database. |
tableName required | string Name of the table. |
minLastUpdatedTime | integer <int64> (EpochTimestamp) >= 0 An exclusive filter, specified as the number of milliseconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
maxLastUpdatedTime | integer <int64> (EpochTimestamp) >= 0 An inclusive filter, specified as the number of milliseconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
numberOfCursors | integer <int32> [ 1 .. 10000 ] The number of cursors to return, by default it's 10. |
{- "items": [
- "string"
]
}
project required | string Example: publicdata The project name. |
dbName required | string Name of the database. |
tableName required | string Name of the table. |
limit | integer <int32> [ 1 .. 10000 ] Default: 25 Limit the number of results. |
columns | string Example: columns=column1,column2 Ordered list of column keys, separated by commas. Leave empty for all, use single comma to retrieve only row keys. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
minLastUpdatedTime | integer <int64> (EpochTimestamp) >= 0 An exclusive filter, specified as the number of milliseconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
maxLastUpdatedTime | integer <int64> (EpochTimestamp) >= 0 An inclusive filter, specified as the number of milliseconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. |
await client.raw.listRows('My company', 'Employees', { columns: ['last_name'] });
{- "items": [
- {
- "key": "string",
- "columns": { },
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Insert rows into a table. It is possible to post a maximum of 10000 rows per request. It will replace the columns of an existing row if the rowKey already exists.
The rowKey is limited to 1024 characters which also includes Unicode characters. The maximum size of columns are 5 MiB, however the maximum size of one column name and value is 2621440 characters each. If you want to store huge amount of data per row or column we recommend using the Files API to upload blobs, then reference it from the Raw row.
The columns object is a key value object, where the key corresponds to the column name while the value is the column value. It supports all the valid types of values in JSON, so number, string, array, and even nested JSON structure (see payload example to the right).
Note There is no rollback if an error occurs, which means partial data may be written. However, it's safe to retry the request, since this endpoint supports both update and insert (upsert).
project required | string Example: publicdata The project name. |
dbName required | string [ 1 .. 32 ] characters Name of the database. |
tableName required | string [ 1 .. 64 ] characters Name of the table. |
ensureParent | boolean Default: false Create database/table if it doesn't exist already |
List of rows to create.
Array of objects (RawDBRowInsert) |
{- "items": [
- {
- "key": "some rowKey",
- "columns": {
- "some int-col": 10,
- "some string-col": "string example",
- "some json-col": {
- "test": {
- "foo": "nested"
}
}, - "some array-col": [
- 0,
- 1,
- 3,
- 4
]
}
}
]
}
{ }
project required | string Example: publicdata The project name. |
dbName required | string [ 1 .. 32 ] characters Name of the database to retrieve the row from. |
tableName required | string [ 1 .. 64 ] characters Name of the table to retrieve the row from. |
rowKey required | string Row key of the row to retrieve. |
await client.raw.retrieveRow('My company', 'Customers', 'customer1');
{- "key": "string",
- "columns": { },
- "lastUpdatedTime": 0
}
project required | string Example: publicdata The project name. |
dbName required | string [ 1 .. 32 ] characters Name of the database containing the rows. |
tableName required | string [ 1 .. 64 ] characters Name of the table containing the rows. |
Keys to the rows to delete.
Array of objects (RawDBRowKey) |
{- "items": [
- {
- "key": "string"
}
]
}
{ }
Extraction Pipeline objects represent the applications and software that are deployed to ingest operational data into CDF. An extraction pipeline can consist of a number of different software components between the source system and CDF. The extraction pipeline object represents the software component that actually sends the data to CDF. Two examples are Cognite extractors and third party ETL tools such as Microsoft Azure or Informatica PowerCenter
Returns a list of all extraction pipelines for a given project
project required | string Example: publicdata The project name. |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
ep_list = client.extraction_pipelines.list(limit=5)
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string",
- "id": 9007199254740991,
- "lastSuccess": 0,
- "lastFailure": 0,
- "lastMessage": "string",
- "lastSeen": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Creates multiple new extraction pipelines. A maximum of 1000 extraction pipelines can be created per request.
project required | string Example: publicdata The project name. |
required | Array of objects (CreateExtPipe) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string"
}
]
}
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string",
- "id": 9007199254740991,
- "lastSuccess": 0,
- "lastFailure": 0,
- "lastMessage": "string",
- "lastSeen": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Delete extraction pipelines for given list of ids and externalIds. When the extraction pipeline is deleted, all extraction pipeline runs related to the extraction pipeline are automatically deleted.
project required | string Example: publicdata The project name. |
required | Array of ExtPipeInternalId (object) or ExtPipeExternalId (object) (ExtPipeId) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 9007199254740991
}
], - "ignoreUnknownIds": false
}
{ }
Update information for a list of extraction pipelines. Fields that are not included in the request, are not changed.
project required | string Example: publicdata The project name. |
required | Array of ExtPipeUpdateById (object) or ExtPipeUpdateByExternalId (object) (ExtPipeUpdate) [ 1 .. 1000 ] items |
{- "items": [
- {
- "id": 9007199254740991,
- "update": {
- "externalId": {
- "set": "string"
}, - "name": {
- "set": "string"
}, - "description": {
- "set": "string"
}, - "dataSetId": {
- "set": 9007199254740991
}, - "schedule": {
- "set": "string"
}, - "rawTables": {
- "set": [
- {
- "dbName": "string",
- "tableName": "string"
}
]
}, - "contacts": {
- "set": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
]
}, - "metadata": {
- "set": {
- "property1": "string",
- "property2": "string"
}
}, - "source": {
- "set": "string"
}, - "documentation": {
- "set": "string"
}, - "notificationConfig": {
- "set": {
- "allowedNotSeenRangeInMinutes": 0
}
}
}
}
]
}
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string",
- "id": 9007199254740991,
- "lastSuccess": 0,
- "lastFailure": 0,
- "lastMessage": "string",
- "lastSeen": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Retrieve an extraction pipeline by its ID. If you want to retrieve extraction pipelines by externalIds, use Retrieve extraction pipelines instead.
project required | string Example: publicdata The project name. |
id required | integer <int64> (CogniteInternalId) [ 1 .. 9007199254740991 ] A server-generated ID for the object. |
res = client.extraction_pipelines.retrieve(id=1) res = client.extraction_pipelines.retrieve(external_id="1")
{- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string",
- "id": 9007199254740991,
- "lastSuccess": 0,
- "lastFailure": 0,
- "lastMessage": "string",
- "lastSeen": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
Retrieves information about multiple extraction pipelines in the same project. All ids and externalIds must be unique.
project required | string Example: publicdata The project name. |
required | Array of ExtPipeInternalId (object) or ExtPipeExternalId (object) (ExtPipeId) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 9007199254740991
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string",
- "id": 9007199254740991,
- "lastSuccess": 0,
- "lastFailure": 0,
- "lastMessage": "string",
- "lastSeen": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Use advanced filtering options to find extraction pipelines.
project required | string Example: publicdata The project name. |
object (ExtPipesFilter) | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
{- "filter": {
- "externalIdPrefix": "string",
- "name": "string",
- "description": "string",
- "dataSetIds": [
- {
- "id": 1
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "createdBy": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}
}, - "limit": 100,
- "cursor": "string"
}
{- "items": [
- {
- "externalId": "string",
- "name": "string",
- "description": "string",
- "dataSetId": 9007199254740991,
- "rawTables": [
- {
- "dbName": "string",
- "tableName": "string"
}
], - "schedule": "string",
- "contacts": [
- {
- "name": "string",
- "email": "user@example.com",
- "role": "string",
- "sendNotification": true
}
], - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "documentation": "string",
- "notificationConfig": {
- "allowedNotSeenRangeInMinutes": 0
}, - "createdBy": "string",
- "id": 9007199254740991,
- "lastSuccess": 0,
- "lastFailure": 0,
- "lastMessage": "string",
- "lastSeen": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Extraction Pipelines Runs are CDF objects to store statuses related to an extraction pipeline. The supported statuses are: success, failure and seen. The statuses are related to two different types of operation of the extraction pipeline. Success and failure indicate the status for a particular EP run where the EP attempts to send data to CDF. If the data is successfully posted to CDF the status of the run is ‘success’; if the run has been unsuccessful and the data is not posted to CDF, the status of the run is ‘failure’. Message can be stored to explain run status. Seen is a heartbeat status that indicates that the extraction pipeline is alive. This message is sent periodically on a schedule and indicates that the extraction pipeline is working even though data may not have been sent to CDF by the extraction pipeline.
List of all extraction pipeline runs for a given extraction pipeline. Sorted by createdTime value with descendant order.
project required | string Example: publicdata The project name. |
externalId required | string |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
{- "items": [
- {
- "id": 1,
- "status": "string",
- "message": "string",
- "createdTime": 0
}
], - "nextCursor": "string"
}
Create multiple extraction pipeline runs. Current version supports one extraction pipeline run per request. Extraction pipeline runs support three statuses: success, failure, seen. The content of the Error Message parameter is configurable and will contain any messages that have been configured within the extraction pipeline.
project required | string Example: publicdata The project name. |
required | Array of objects (ExtPipeRunRequest) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "string",
- "status": "success",
- "message": "string",
- "createdTime": 0
}
]
}
{- "items": [
- {
- "id": 1,
- "status": "string",
- "message": "string",
- "createdTime": 0,
- "externalId": "string"
}
]
}
Use advanced filtering options to find extraction pipeline runs. Sorted by createdTime value with descendant order.
project required | string Example: publicdata The project name. |
required | object (RunsFilter) |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
{- "filter": {
- "externalId": "string",
- "statuses": [
- "success"
], - "createdTime": {
- "max": 0,
- "min": 0
}, - "message": {
- "substring": "string"
}
}, - "limit": 100,
- "cursor": "string"
}
{- "items": [
- {
- "id": 1,
- "status": "string",
- "message": "string",
- "createdTime": 0
}
], - "nextCursor": "string"
}
Extraction Pipelines Configs are configuration file revisions tied to an extraction pipeline. Users can create new configuration revisions, and extractors can fetch the latest, making it easy to deploy configuration files from source control, automated scripts, etc.
Retrieves a single configuration revision. By default, the latest revision is retrieved.
project required | string Example: publicdata The project name. |
externalId required | string |
revision | integer <int32> >= 0 Default: 0 |
activeAtTime | integer <int64> >= 0 Default: 0 |
{- "externalId": "string",
- "config": "string",
- "revision": 2147483647,
- "createdTime": 0,
- "description": "string"
}
Creates a configuration revision for the given extraction pipeline.
project required | string Example: publicdata The project name. |
externalId required | string [ 1 .. 255 ] characters External ID of the extraction pipeline this configuration revision belongs to. |
config | string Configuration content. |
description | string or null A description of this configuration revision. |
{- "externalId": "string",
- "config": "string",
- "description": "string"
}
{- "externalId": "string",
- "config": "string",
- "revision": 2147483647,
- "createdTime": 0,
- "description": "string"
}
Lists configuration revisions for the given extraction pipeline.
project required | string Example: publicdata The project name. |
externalId required | string |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
{- "items": [
- {
- "externalId": "string",
- "revision": 2147483647,
- "createdTime": 0,
- "description": "string"
}
]
}
Reverts the latest configuration revision to an older revision. Equivalent to creating a new revision identical to the old revision.
project required | string Example: publicdata The project name. |
externalId required | string [ 1 .. 255 ] characters External ID of the extraction pipeline to revert configurations for. |
revision | integer <int32> [ 0 .. 2147483647 ] Revision number of this configuration. |
{- "externalId": "string",
- "revision": 2147483647
}
{- "externalId": "string",
- "config": "string",
- "revision": 2147483647,
- "createdTime": 0,
- "description": "string"
}
Data sets let you document and track data lineage, ensure data integrity, and allow 3rd parties to write their insights securely back to a Cognite Data Fusion (CDF) project.
Data sets group and track data by its source. For example, a data set can contain all work orders originating from SAP. Typically, an organization will have one data set for each of its data ingestion pipelines in CDF.
A data set consists of metadata about the data set, and the data objects that belong to the data set. Data objects, for example events, files, and time series, are added to a data set through the dataSetId
field of the data object. Each data object can belong to only one data set.
To learn more about data sets, see getting started guide
You can create a maximum of 10 data sets per request.
project required | string Example: publicdata The project name. |
List of the data sets to create.
required | Array of objects (DataSetSpec) [ 1 .. 10 ] items |
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "writeProtected": false
}
]
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "writeProtected": false,
- "id": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Use advanced filtering options to find data sets.
project required | string Example: publicdata The project name. |
List of IDs of the data sets to retrieve. You can retrieve a maximum of 1000 data sets per request. All IDs must be unique.
object (DataSetFilter) Filter on data sets with strict matching. | |
limit | integer <int32> [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
{- "filter": {
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix",
- "writeProtected": true
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "writeProtected": false,
- "id": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Aggregate data sets in the same project. Criteria can be applied to select a subset of data sets.
project required | string Example: publicdata The project name. |
object (DataSetFilter) Filter on data sets with strict matching. |
{- "filter": {
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix",
- "writeProtected": true
}
}
{- "items": [
- {
- "count": 0
}
]
}
Retrieve data sets by IDs or external IDs.
project required | string Example: publicdata The project name. |
List of the IDs of the data sets to retrieve. You can retrieve a maximum of 1000 data sets per request. All IDs must be unique.
required | Array of DataSetInternalId (object) or DataSetExternalId (object) (DataSetIdEither) [ 1 .. 1000 ] items unique |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "writeProtected": false,
- "id": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
project required | string Example: publicdata The project name. |
All provided IDs and external IDs must be unique. Fields that are not included in the request, are not changed.
required | Array of DataSetChangeById (object) or DataSetChangeByExternalId (object) (DataSetUpdate) |
{- "items": [
- {
- "update": {
- "externalId": {
- "set": "string"
}, - "name": {
- "set": "string"
}, - "description": {
- "set": "string"
}, - "metadata": {
- "set": {
- "key1": "value1",
- "key2": "value2"
}
}, - "writeProtected": {
- "set": true
}
}, - "id": 1
}
]
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "writeProtected": false,
- "id": 1,
- "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Creates label definitions that can be used across different resource types. The label definitions are uniquely identified by their external id.
project required | string Example: publicdata The project name. |
List of label definitions to create
required | Array of objects (ExternalLabelDefinition) [ 1 .. 1000 ] items unique |
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1
}
]
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "createdTime": 0
}
]
}
Use advanced filtering options to find label definitions.
project required | string Example: publicdata The project name. |
object (Filter) Filter on labels definitions with strict matching. | |
cursor | string |
limit | integer [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
{- "filter": {
- "name": "string",
- "externalIdPrefix": "string",
- "dataSetIds": [
- {
- "id": 1
}
]
}, - "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "limit": 100
}
{- "items": [
- {
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "createdTime": 0
}
], - "nextCursor": "string"
}
Delete all the label definitions specified by their external ids. The resource items that have the corresponding label attached remain unmodified. It is up to the client to clean up the resource items from their attached labels if necessary.
project required | string Example: publicdata The project name. |
List of external ids of label definitions to delete.
required | Array of objects (LabelDefinitionExternalId) [ 1 .. 1000 ] items unique |
{- "items": [
- {
- "externalId": "my.known.id"
}
]
}
{ }
The relationships resource type represents connections between resource objects in CDF. Relationships allow you to organize assets in other structures in addition to the standard hierarchical asset structure. Each relationship is between a source and a target object and is defined by a relationship type and the external IDs and resource types of the source and target objects. Optionally, a relationship can be time-constrained with a start and end time. To define and manage the available relationship types, use the labels resource type. The externalId field uniquely identifies each relationship.
List of the relationships to create. You can create a maximum of 1000 relationships per request. Relationships should be unique, but CDF does not prevent you from creating duplicates where only the externalId differs.
Relationships are uniquely identified by their externalId. Non-unique relationships will not be created.
The order of relationships in the response equals the order in the request.
project required | string Example: publicdata The project name. |
Data required to create relationships. You can request a maximum of 1000 relationships per request.
required | Array of objects (relationship) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "string",
- "sourceExternalId": "string",
- "sourceType": "asset",
- "targetExternalId": "string",
- "targetType": "asset",
- "startTime": 0,
- "endTime": 0,
- "confidence": 1,
- "dataSetId": 1,
- "labels": [
- {
- "externalId": "my.known.id"
}
]
}
]
}
{- "items": [
- {
- "externalId": "string",
- "sourceExternalId": "string",
- "sourceType": "asset",
- "targetExternalId": "string",
- "targetType": "asset",
- "startTime": 0,
- "endTime": 0,
- "confidence": 1,
- "dataSetId": 1,
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Lists all relationships. The order of retrieved objects may change for two calls with the same parameters. The endpoint supports pagination. The initial call to this endpoint should not contain a cursor, but the cursor parameter should be used to retrieve further pages of results.
project required | string Example: publicdata The project name. |
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 Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
partition | string Example: partition=1/10 Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "items": [
- {
- "externalId": "string",
- "sourceExternalId": "string",
- "sourceType": "asset",
- "targetExternalId": "string",
- "targetType": "asset",
- "startTime": 0,
- "endTime": 0,
- "confidence": 1,
- "dataSetId": 1,
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "createdTime": 0,
- "lastUpdatedTime": 0
}
], - "nextCursor": "string"
}
Update relationships between resources according to the partial definitions of the relationships given in the payload of the request. This means that fields not mentioned in the payload will remain unchanged. Up to 1000 relationships can be updated in one operation.
To delete a value from an optional value the setNull
field should be set to true
.
The order of the updated relationships in the response equals the order in the request.
project required | string Example: publicdata The project name. |
Data required to update relationships.
required | Array of objects (relationshipUpdate) [ 1 .. 1000 ] items |
{- "items": [
- {
- "externalId": "string",
- "update": {
- "sourceType": {
- "set": "asset"
}, - "sourceExternalId": {
- "set": "string"
}, - "targetType": {
- "set": "asset"
}, - "targetExternalId": {
- "set": "string"
}, - "confidence": {
- "set": 1
}, - "startTime": {
- "set": 0
}, - "endTime": {
- "set": 0
}, - "dataSetId": {
- "set": 1
}, - "labels": {
- "add": [
- {
- "externalId": "my.known.id"
}
], - "remove": [
- {
- "externalId": "my.known.id"
}
]
}
}
}
]
}
{- "items": [
- {
- "externalId": "string",
- "sourceExternalId": "string",
- "sourceType": "asset",
- "targetExternalId": "string",
- "targetType": "asset",
- "startTime": 0,
- "endTime": 0,
- "confidence": 1,
- "dataSetId": 1,
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "createdTime": 0,
- "lastUpdatedTime": 0
}
]
}
Delete the relationships between resources identified by the external IDs in the request. You can delete a maximum of 1000 relationships per request.
project required | string Example: publicdata The project name. |
Data required to delete relationships. You can delete a maximum of 1000 relationships per request.
required | Array of objects (itemsArray) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean (ignoreUnknownIds) Default: false Ignore external IDs that are not found. |
{- "items": [
- {
- "externalId": "string"
}
], - "ignoreUnknownIds": false
}
{ }
Retrieve relationships by external IDs. You can retrieve a maximum of 1000 relationships per request. The order of the relationships in the response equals the order in the request.
project required | string Example: publicdata The project name. |
Data required to list relationships.
required | Array of objects (itemsArray) [ 1 .. 1000 ] items |
ignoreUnknownIds | boolean (ignoreUnknownIds) Default: false Ignore external IDs that are not found. |
fetchResources | boolean (fetchResources) Default: false If true, will try to fetch the resources referred to in the relationship, based on the users access rights. Will silently fail to attatch the resources if the user lacks access to some of them. |
{- "items": [
- {
- "externalId": "string"
}
], - "ignoreUnknownIds": false,
- "fetchResources": false
}
{- "items": [
- {
- "externalId": "string",
- "sourceExternalId": "string",
- "sourceType": "asset",
- "targetExternalId": "string",
- "targetType": "asset",
- "startTime": 0,
- "endTime": 0,
- "confidence": 1,
- "dataSetId": 1,
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "createdTime": 0,
- "lastUpdatedTime": 0,
- "source": {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}, - "target": {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
}
]
}
Lists relationships matching the query filter in the request. You can retrieve a maximum of 1000 relationships per request.
project required | string Example: publicdata The project name. |
Data required to filter relationships. Combined filters are interpreted as an AND operation (not OR). Only relationships that match ALL the provided filters are returned.
object (advancedListFilter) Filter on relationships with exact match. Multiple filter elements in one property, for example | |
limit | integer [ 1 .. 1000 ] Default: 100 Limits the number of results to return. |
cursor | string |
fetchResources | boolean (fetchResources) Default: false If true, will try to fetch the resources referred to in the relationship, based on the users access rights. Will silently fail to attatch the resources if the user lacks access to some of them. |
partition | string (Partition) Splits the data set into N partitions. You need to follow the cursors within each partition in order to receive all the data. Example: 1/10 |
{- "filter": {
- "sourceExternalIds": [
- "string"
], - "sourceTypes": [
- "asset"
], - "targetExternalIds": [
- "string"
], - "targetTypes": [
- "asset"
], - "dataSetIds": [
- {
- "id": 1
}
], - "startTime": {
- "max": 0,
- "min": 0
}, - "endTime": {
- "max": 0,
- "min": 0
}, - "confidence": {
- "min": 0,
- "max": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "createdTime": {
- "max": 0,
- "min": 0
}, - "activeAtTime": {
- "max": 0,
- "min": 0
}, - "labels": {
- "containsAny": [
- {
- "externalId": "my.known.id"
}
]
}, - "sourcesOrTargets": [
- {
- "type": "asset",
- "externalId": "string"
}
]
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "fetchResources": false,
- "partition": "1/10"
}
{- "items": [
- {
- "externalId": "string",
- "sourceExternalId": "string",
- "sourceType": "asset",
- "targetExternalId": "string",
- "targetType": "asset",
- "startTime": 0,
- "endTime": 0,
- "confidence": 1,
- "dataSetId": 1,
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "createdTime": 0,
- "lastUpdatedTime": 0,
- "source": {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}, - "target": {
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "rootId": 1,
- "aggregates": {
- "childCount": 0,
- "depth": 0,
- "path": [
- {
- "id": 1
}
]
}, - "parentId": 1,
- "parentExternalId": "my.known.id",
- "externalId": "my.known.id",
- "name": "string",
- "description": "string",
- "dataSetId": 1,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "source": "string",
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 0,
- 0
]
}, - "properties": { }
}, - "id": 1
}
}
], - "nextCursor": "string"
}
Annotations reflect contextual information in base CDF resource types, such as Files and Time series, that are not present on the object itself. The benefits of the annotations concept are threefold:
Creates the given annotations.
An annotation must reference an annotated resource.
The reference can be made by providing the internal ID of the annotated resource.
The annotation must have the status
field set to either "suggested", "rejected", or "approved"
The caller must have read-access on all the annotated resources, otherwise the call will fail.
The annotation type property must be set to one of the globally available annotation types.
See the documentation of the annotationType
and data
attributes for details.
The annotation data must conform to the schema provided by the annotation type.
The creating application and its version must be provided. The creating user must be provided, but if the
annotation is being created by a service, this can be set to null
.
project required | string Example: publicdata The project name. |
A request for creating annotations
required | Array of objects (AnnotationsV2CreateSchema) [ 1 .. 1000 ] A list of annotations to create |
{- "items": [
- {
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
]
}
{- "items": [
- {
- "id": 4096,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
]
}
Suggests the given annotations, i.e. creates them with status
set to "suggested"
An annotation must reference an annotated resource.
The reference can be made by providing the internal ID of the annotated resource.
The caller must have read-access on all the annotated resources, otherwise the call will fail.
The annotation type property must be set to one of the globally available annotation types.
See the documentation of the annotationType
and data
attributes for details.
The annotation data must conform to the schema provided by the annotation type.
The creating application and its version must be provided. The creating user must be provided, but if the
annotation is being created by a service, this can be set to null
.
project required | string Example: publicdata The project name. |
A request for suggesting annotations, i.e., creating them with the "suggested" status
required | Array of objects (AnnotationsV2SuggestSchema) [ 1 .. 1000 ] A list of annotations to suggest |
{- "items": [
- {
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}
}
]
}
{- "items": [
- {
- "id": 4096,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
]
}
Retrieves the referenced annotation.
The caller must have read-access on the annotated resource, otherwise the call will fail.
project required | string Example: publicdata The project name. |
annotationId required | integer <int64> (AnnotationId) [ 1 .. 9007199254740991 ] Example: 4096 The internal ID of the annotation |
{- "id": 4096,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
Lists the annotations the caller has access to, based on a filter.
The caller must have read-access on the annotated resources listed in the filter, otherwise the call will fail.
project required | string Example: publicdata The project name. |
A request specifying the annotation listing behavior
cursor | string or null [ 1 .. 255 ] characters A cursor pointing to another page of results |
limit | integer [ 1 .. 1000 ] Default: 25 |
required | object (AnnotationsV2FilterSchema) A filter to apply on annotations |
{- "cursor": "MzE1NjAwMDcxNzQ0ODI5",
- "limit": 25,
- "filter": {
- "annotatedResourceType": "file",
- "annotatedResourceIds": [
- {
- "id": 1066
}, - {
- "id": 1067
}
], - "status": "approved",
- "data": {
- "label": "cat"
}
}
}
{- "items": [
- {
- "id": 4096,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
], - "nextCursor": null
}
Retrieves the referenced annotations.
The caller must have read-access on all the annotated resources, otherwise the call will fail.
project required | string Example: publicdata The project name. |
A request referencing existing annotations
required | Array of objects (AnnotationsV2ReferenceSchema) [ 1 .. 1000 ] A list of existing annotation references |
{- "items": [
- {
- "id": 4096
}
]
}
{- "items": [
- {
- "id": 4096,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
]
}
Deletes the referenced annotations completely.
The caller must have read-access on all the annotated resources, otherwise the call will fail.
project required | string Example: publicdata The project name. |
A request referencing existing annotations
required | Array of objects (AnnotationsV2ReferenceSchema) [ 1 .. 1000 ] A list of existing annotation references |
{- "items": [
- {
- "id": 4096
}
]
}
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}
Updates the referenced annotations.
The caller must have read-access on all the annotated resources, otherwise the call will fail.
project required | string Example: publicdata The project name. |
A request for updating existing annotations
required | Array of objects (AnnotationsV2UpdateItemSchema) [ 1 .. 1000 ] |
{- "items": [
- {
- "id": 4096,
- "update": {
- "data": {
- "set": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.4,
- "xMax": 0.5,
- "yMin": 0.4,
- "yMax": 0.5
}, - "pageNumber": 43
}
}
}
}
]
}
{- "items": [
- {
- "id": 4096,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "annotatedResourceType": "file",
- "annotatedResourceId": 1337,
- "annotationType": "images.ObjectDetection",
- "creatingApp": "cognite-vision",
- "creatingAppVersion": "1.2.1",
- "creatingUser": "john.doe@cognite.com",
- "data": {
- "assetRef": {
- "externalId": "abc"
}, - "symbolRegion": {
- "xMin": 0.1,
- "xMax": 0.2,
- "yMin": 0.1,
- "yMax": 0.2
}, - "textRegion": {
- "xMin": 0.2,
- "xMax": 0.3,
- "yMin": 0.2,
- "yMax": 0.3
}, - "pageNumber": 43
}, - "status": "approved"
}
]
}
Transformations enable users to use Spark SQL queries to transform data from the CDF staging area, RAW, into the CDF data model.
List transformations. Use nextCursor to paginate through the results.
project required | string The project name. |
limit | integer <int32> [ 1 .. 1000 ] Limits the number of results to be returned. The maximum is 1000, default limit is 100. |
cursor | string Cursor for paging through results. |
includePublic | boolean Whether public transformations should be included in the results. The default is true. |
withJobDetails | boolean Whether transformations should contain information about jobs. The default is true. |
transformations_list = client.transformations.list()
{- "items": [
- {
- "id": 0,
- "name": "string",
- "query": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "isPublic": true,
- "blocked": {
- "reason": "string",
- "createdTime": 0
}, - "createdTime": 0,
- "lastUpdatedTime": 0,
- "owner": "string",
- "ownerIsCurrentUser": true,
- "hasSourceApiKey": true,
- "hasDestinationApiKey": true,
- "hasSourceOidcCredentials": true,
- "hasDestinationOidcCredentials": true,
- "sourceSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "destinationSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "lastFinishedJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "runningJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "schedule": {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}, - "externalId": "string",
- "ignoreNullFields": true,
- "dataSetId": 0,
- "tags": [
- "string"
]
}
], - "nextCursor": "string"
}
Create a maximum of 1000 transformations per request.
project required | string The project name. |
Array of objects (TransformationCreate) <= 1000 items |
{- "items": [
- {
- "name": "string",
- "query": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "isPublic": true,
- "sourceApiKey": "string",
- "destinationApiKey": "string",
- "sourceOidcCredentials": {
- "clientId": "string",
- "clientSecret": "string",
- "scopes": "string",
- "tokenUri": "string",
- "cdfProjectName": "string",
- "audience": "string"
}, - "destinationOidcCredentials": {
- "clientId": "string",
- "clientSecret": "string",
- "scopes": "string",
- "tokenUri": "string",
- "cdfProjectName": "string",
- "audience": "string"
}, - "sourceNonce": {
- "sessionId": 0,
- "nonce": "string",
- "cdfProjectName": "string",
- "clientId": "string"
}, - "destinationNonce": {
- "sessionId": 0,
- "nonce": "string",
- "cdfProjectName": "string",
- "clientId": "string"
}, - "externalId": "string",
- "ignoreNullFields": true,
- "dataSetId": 0,
- "tags": [
- "string"
]
}
]
}
{- "items": [
- {
- "id": 0,
- "name": "string",
- "query": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "isPublic": true,
- "blocked": {
- "reason": "string",
- "createdTime": 0
}, - "createdTime": 0,
- "lastUpdatedTime": 0,
- "owner": "string",
- "ownerIsCurrentUser": true,
- "hasSourceApiKey": true,
- "hasDestinationApiKey": true,
- "hasSourceOidcCredentials": true,
- "hasDestinationOidcCredentials": true,
- "sourceSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "destinationSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "lastFinishedJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "runningJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "schedule": {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}, - "externalId": "string",
- "ignoreNullFields": true,
- "dataSetId": 0,
- "tags": [
- "string"
]
}
]
}
Retrieve a maximum of 1000 transformations by ids and externalIds per request.
project required | string The project name. |
Array of TransformationCogniteExternalId (object) or TransformationCogniteInternalId (object) <= 1000 items | |
ignoreUnknownIds | boolean Ignore IDs and external IDs that are not found. Defaults to false. |
withJobDetails required | boolean Whether the transformations will be returned with running job and last created job details. |
{- "items": [
- {
- "externalId": "string"
}
], - "ignoreUnknownIds": true,
- "withJobDetails": true
}
{- "items": [
- {
- "id": 0,
- "name": "string",
- "query": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "isPublic": true,
- "blocked": {
- "reason": "string",
- "createdTime": 0
}, - "createdTime": 0,
- "lastUpdatedTime": 0,
- "owner": "string",
- "ownerIsCurrentUser": true,
- "hasSourceApiKey": true,
- "hasDestinationApiKey": true,
- "hasSourceOidcCredentials": true,
- "hasDestinationOidcCredentials": true,
- "sourceSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "destinationSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "lastFinishedJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "runningJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "schedule": {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}, - "externalId": "string",
- "ignoreNullFields": true,
- "dataSetId": 0,
- "tags": [
- "string"
]
}
]
}
Filter transformations. Use nextCursor to paginate through the results.
project required | string The project name. |
required | object (TransformationFilter) |
limit | integer <int32> |
cursor | string |
{- "filter": {
- "isPublic": true,
- "nameRegex": "string",
- "queryRegex": "string",
- "destinationType": "string",
- "conflictMode": "abort",
- "hasBlockedError": true,
- "cdfProjectName": "string",
- "createdTime": {
- "min": 0,
- "max": 0
}, - "lastUpdatedTime": {
- "min": 0,
- "max": 0
}, - "dataSetIds": [
- {
- "externalId": "string"
}
], - "tags": {
- "containsAny": [
- "string"
]
}
}, - "limit": 0,
- "cursor": "string"
}
{- "items": [
- {
- "id": 0,
- "name": "string",
- "query": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "isPublic": true,
- "blocked": {
- "reason": "string",
- "createdTime": 0
}, - "createdTime": 0,
- "lastUpdatedTime": 0,
- "owner": "string",
- "ownerIsCurrentUser": true,
- "hasSourceApiKey": true,
- "hasDestinationApiKey": true,
- "hasSourceOidcCredentials": true,
- "hasDestinationOidcCredentials": true,
- "sourceSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "destinationSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "lastFinishedJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "runningJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "schedule": {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}, - "externalId": "string",
- "ignoreNullFields": true,
- "dataSetId": 0,
- "tags": [
- "string"
]
}
], - "nextCursor": "string"
}
Delete a maximum of 1000 transformations by ids and externalIds per request.
project required | string The project name. |
Array of TransformationCogniteExternalId (object) or TransformationCogniteInternalId (object) <= 1000 items | |
ignoreUnknownIds | boolean Ignore IDs and external IDs that are not found. Defaults to false. |
{- "items": [
- {
- "externalId": "string"
}
], - "ignoreUnknownIds": true
}
{ }
Update the attributes of transformations, maximum 1000 per request.
project required | string The project name. |
Array of UpdateItemWithExternalId_TransformationUpdate (object) or UpdateItemWithId_TransformationUpdate (object) <= 1000 items |
{- "items": [
- {
- "update": {
- "name": {
- "set": "string"
}, - "externalId": {
- "set": "string"
}, - "destination": {
- "set": {
- "type": "assets"
}
}, - "conflictMode": {
- "set": "abort"
}, - "query": {
- "set": "string"
}, - "sourceOidcCredentials": {
- "setNull": true
}, - "destinationOidcCredentials": {
- "setNull": true
}, - "sourceNonce": {
- "setNull": true
}, - "destinationNonce": {
- "setNull": true
}, - "sourceApiKey": {
- "setNull": true
}, - "destinationApiKey": {
- "setNull": true
}, - "isPublic": {
- "set": true
}, - "ignoreNullFields": {
- "set": true
}, - "dataSetId": {
- "setNull": true
}, - "tags": {
- "set": [
- "string"
]
}
}, - "externalId": "string"
}
]
}
{- "items": [
- {
- "id": 0,
- "name": "string",
- "query": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "isPublic": true,
- "blocked": {
- "reason": "string",
- "createdTime": 0
}, - "createdTime": 0,
- "lastUpdatedTime": 0,
- "owner": "string",
- "ownerIsCurrentUser": true,
- "hasSourceApiKey": true,
- "hasDestinationApiKey": true,
- "hasSourceOidcCredentials": true,
- "hasDestinationOidcCredentials": true,
- "sourceSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "destinationSession": {
- "clientId": "string",
- "sessionId": 0,
- "projectName": "string"
}, - "lastFinishedJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "runningJob": {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}, - "schedule": {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}, - "externalId": "string",
- "ignoreNullFields": true,
- "dataSetId": 0,
- "tags": [
- "string"
]
}
]
}
project required | string The project name. |
externalId required | string |
object (NonceCredentials) |
{- "externalId": "string",
- "nonce": {
- "sessionId": 0,
- "nonce": "string",
- "cdfProjectName": "string",
- "clientId": "string"
}
}
{- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}
project required | string The project name. |
externalId required | string The external ID provided by the client. Must be unique for the resource type. |
{- "externalId": "string"
}
{ }
project required | string The project name. |
transformationId | integer <int32> List only jobs for the specified transformation. The transformation is identified by ID. |
transformationExternalId | string List only jobs for the specified transformation. The transformation is identified by external ID. |
limit | integer <int32> [ 1 .. 1000 ] Limits the number of results to be returned. The maximum is 1000, default limit is 100. |
cursor | string Cursor for paging through results. |
transformation_jobs_list = client.transformations.jobs.list() transformation_jobs_list = client.transformations.jobs.list(transformation_id = 1)
{- "items": [
- {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}
], - "nextCursor": "string"
}
Retrieve a maximum of 1000 jobs by ids per request.
project required | string The project name. |
Array of objects (TransformationCogniteInternalId) | |
ignoreUnknownIds | boolean Ignore IDs and external IDs that are not found. Defaults to false. |
{- "items": [
- {
- "id": 0
}
], - "ignoreUnknownIds": true
}
{- "items": [
- {
- "id": 0,
- "uuid": "string",
- "transformationId": 0,
- "transformationExternalId": "string",
- "sourceProject": "string",
- "destinationProject": "string",
- "destination": {
- "type": "assets"
}, - "conflictMode": "abort",
- "query": "string",
- "createdTime": 0,
- "startedTime": 0,
- "finishedTime": 0,
- "lastSeenTime": 0,
- "error": "string",
- "ignoreNullFields": true,
- "status": "Completed"
}
]
}
project required | string The project name. |
id required | integer <int32> The job id. |
res = client.transformations.jobs.list_metrics(id=1)
{- "items": [
- {
- "timestamp": 0,
- "name": "assets.read",
- "count": 0
}
]
}
Transformation schedules allow you to run transformations with a specific input at intervals defined by a cron expression. These transformation jobs will be asynchronous and show up in the transformation job list. Visit http://www.cronmaker.com to generate a cron expression with a UI.
List all transformation schedules. Use nextCursor to paginate through the results.
project required | string The project name. |
limit | integer <int32> [ 1 .. 1000 ] Limits the number of results to be returned. The maximum is 1000, default limit is 100. |
cursor | string Cursor for paging through results. |
includePublic | boolean Whether public transformations should be included in the results. The default is true. |
schedules_list = client.transformations.schedules.list()
{- "items": [
- {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}
], - "nextCursor": "string"
}
Schedule transformations with the specified configurations.
project required | string The project name. |
List of the schedules to create. Must be up to a maximum of 1000 items.
Array of ScheduleParametersWithExternalId (object) or ScheduleParametersWithId (object) |
{- "items": [
- {
- "interval": "string",
- "isPaused": true,
- "externalId": "string"
}
]
}
{- "items": [
- {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}
]
}
Retrieve transformation schedules by transformation IDs or external IDs.
project required | string The project name. |
List of transformation IDs of schedules to retrieve. Must be up to a maximum of 1000 items and all of them must be unique.
Array of TransformationCogniteExternalId (object) or TransformationCogniteInternalId (object) <= 1000 items | |
ignoreUnknownIds | boolean Ignore IDs and external IDs that are not found. Defaults to false. |
{- "items": [
- {
- "externalId": "string"
}
], - "ignoreUnknownIds": true
}
{- "items": [
- {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}
]
}
Unschedule transformations by IDs or externalIds.
project required | string The project name. |
List of transformation IDs of schedules to delete. Must be up to a maximum of 1000 items and all of them must be unique.
Array of TransformationCogniteExternalId (object) or TransformationCogniteInternalId (object) <= 1000 items | |
ignoreUnknownIds | boolean Ignore IDs and external IDs that are not found. Defaults to false. |
{- "items": [
- {
- "externalId": "string"
}
], - "ignoreUnknownIds": true
}
{ }
project required | string The project name. |
List of schedule updates. Must be up to a maximum of 1000 items.
Array of UpdateItemWithExternalId_ScheduleUpdate (object) or UpdateItemWithId_ScheduleUpdate (object) |
{- "items": [
- {
- "update": {
- "interval": {
- "set": "string"
}, - "isPaused": {
- "set": true
}
}, - "externalId": "string"
}
]
}
{- "items": [
- {
- "id": 0,
- "externalId": "string",
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "interval": "string",
- "isPaused": true
}
]
}
Transformation notifications let users know when a job fails if subscribed.
project required | string The project name. |
transformationId | integer <int32> List only notifications for the specified transformation. The transformation is identified by ID. |
transformationExternalId | string List only notifications for the specified transformation. The transformation is identified by external ID. |
destination | string Filter by notification destination. |
limit | integer <int32> [ 1 .. 1000 ] Limits the number of results to be returned. The maximum is 1000, default limit is 100. |
cursor | string Cursor for paging through results. |
notifications_list = client.transformations.notifications.list() notifications_list = client.transformations.notifications.list(transformation_id = 1)
{- "items": [
- {
- "id": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "transformationId": 0,
- "destination": "string"
}
], - "nextCursor": "string"
}
Subscribe for notifications on the transformation errors.
project required | string The project name. |
List of the notifications for new subscriptions. Must be up to a maximum of 1000 items.
Array of NotificationCreateWithExternalId (object) or NotificationCreateWithId (object) <= 1000 items |
{- "items": [
- {
- "destination": "string",
- "transformationExternalId": "string"
}
]
}
{- "items": [
- {
- "id": 0,
- "createdTime": 0,
- "lastUpdatedTime": 0,
- "transformationId": 0,
- "destination": "string"
}
]
}
Deletes the specified notification subscriptions on the transformation. Requests to delete non-existing subscriptions do nothing, but do not throw an error.
project required | string The project name. |
List of IDs to be deleted.
Array of objects (TransformationCogniteInternalId) |
{- "items": [
- {
- "id": 0
}
]
}
{ }
Preview a SQL query.
project required | string The project name. |
query required | string SQL query to run for preview. |
convertToString required | boolean Stringify values in the query results. |
limit | integer <int32> End-result limit of the query. |
sourceLimit | integer <int32> Limit for how many rows to download from the data sources. |
inferSchemaLimit | integer <int32> Limit for how many rows that are used for inferring schema. Default is 10,000. |
timeout | integer <int32> Number of seconds to wait before cancelling a query. The default, and maximum, is 240. |
{- "query": "string",
- "convertToString": true,
- "limit": 0,
- "sourceLimit": 0,
- "inferSchemaLimit": 0,
- "timeout": 0
}
{- "schema": {
- "items": [
- {
- "name": "string",
- "sqlType": "string",
- "type": {
- "type": "string"
}, - "nullable": true
}
]
}, - "results": {
- "items": [
- {
- "property1": "string",
- "property2": "string"
}
]
}
}
project required | string The project name. |
externalId required | string non-empty External ID of the Sequence |
{- "items": [
- {
- "name": "string",
- "sqlType": "string",
- "type": {
- "type": "string"
}, - "nullable": true
}
]
}
project required | string The project name. |
schemaType required | string Name of the target schema type, please provide one of the following:
|
conflictMode | string One of the following conflictMode types can be provided:
|
from cognite.client.data_classes import TransformationDestination client.lumns = client.transformations.schema.retrieve(destination = TransformationDestination.assets())
{- "items": [
- {
- "name": "string",
- "sqlType": "string",
- "type": {
- "type": "string"
}, - "nullable": true
}
]
}
Functions enables Python code to be hosted and executed in the cloud, on demand or by using a schedule. Execution, status and logs are available through the API. A function is uploaded to the Files API as a zip file with at least a Python file called handler.py
(unless specified otherwise through the functionPath
-argument) that must contain a function named handle
with any of the following arguments: data
, client
, secrets
, or 'function_call_info', which are passed into the function.
The latest version of Cognite SDK's are available, and additional python packages and version specifications can be defined in a requirements.txt
in the root of the zip.
List functions.
project required | string Example: publicdata The project name. |
limit | integer >= 1 Default: 100 Limits the number of results to be returned. |
{- "items": [
- {
- "id": 1,
- "createdTime": 123455234,
- "status": "Queued",
- "name": "myfunction",
- "externalId": "my.known.id",
- "fileId": 1,
- "owner": "user@cognite.com",
- "description": "My fantastic function with advanced ML",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "apiKey": "***",
- "secrets": {
- "MySecret": "***"
}, - "functionPath": "myfunction/handler.py",
- "envVars": {
- "MyKey": "MyValue"
}, - "cpu": 0.25,
- "memory": 1,
- "runtime": "py38",
- "runtimeVersion": "Python 3.8.13",
- "error": {
- "code": 400,
- "message": "Could not build function."
}
}
]
}
You can only create one function per request.
project required | string Example: publicdata The project name. |
required | Array of objects (Function) = 1 items Array of functions to create. |
{- "items": [
- {
- "name": "My awesome function",
- "fileId": 5467347282343
}
]
}
{- "items": [
- {
- "id": 1,
- "createdTime": 123455234,
- "status": "Queued",
- "name": "myfunction",
- "externalId": "my.known.id",
- "fileId": 1,
- "owner": "user@cognite.com",
- "description": "My fantastic function with advanced ML",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "apiKey": "***",
- "secrets": {
- "MySecret": "***"
}, - "functionPath": "myfunction/handler.py",
- "envVars": {
- "MyKey": "MyValue"
}, - "cpu": 0.25,
- "memory": 1,
- "runtime": "py38",
- "runtimeVersion": "Python 3.8.13",
- "error": {
- "code": 400,
- "message": "Could not build function."
}
}
]
}
Service limits for the associated project.
project required | string Example: publicdata The project name. |
limits = client.functions.limits()
{- "timeoutMinutes": 15,
- "cpuCores": {
- "min": 0.1,
- "max": 0.6,
- "default": 0.25
}, - "memoryGb": {
- "min": 0.1,
- "max": 2.5,
- "default": 1
}, - "runtimes": [
- "py37",
- "py38",
- "py39"
], - "responseSizeMb": 1
}
Use advanced filtering options to find functions.
project required | string Example: publicdata The project name. |
object (FunctionFilter) | |
limit | integer <int32> >= 1 Default: 100 Limits the number of results to be returned. |
{- "filter": {
- "status": "Queued",
- "createdTime": {
- "min": 10,
- "max": 199
}
}
}
{- "items": [
- {
- "id": 1,
- "createdTime": 123455234,
- "status": "Queued",
- "name": "myfunction",
- "externalId": "my.known.id",
- "fileId": 1,
- "owner": "user@cognite.com",
- "description": "My fantastic function with advanced ML",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "apiKey": "***",
- "secrets": {
- "MySecret": "***"
}, - "functionPath": "myfunction/handler.py",
- "envVars": {
- "MyKey": "MyValue"
}, - "cpu": 0.25,
- "memory": 1,
- "runtime": "py38",
- "runtimeVersion": "Python 3.8.13",
- "error": {
- "code": 400,
- "message": "Could not build function."
}
}
]
}
Delete functions. You can delete a maximum of 10 functions per request. Function source files stored in the Files API must be deleted separately.
project required | string Example: publicdata The project name. |
required | Array of FunctionId (object) or FunctionExternalId (object) (FunctionIdEither) [ 1 .. 10 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{ }
Retrieve a function by its id. If you want to retrieve functions by names, use Retrieve functions instead.
project required | string Example: publicdata The project name. |
functionId required | integer The function id. |
{- "id": 1,
- "createdTime": 123455234,
- "status": "Queued",
- "name": "myfunction",
- "externalId": "my.known.id",
- "fileId": 1,
- "owner": "user@cognite.com",
- "description": "My fantastic function with advanced ML",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "apiKey": "***",
- "secrets": {
- "MySecret": "***"
}, - "functionPath": "myfunction/handler.py",
- "envVars": {
- "MyKey": "MyValue"
}, - "cpu": 0.25,
- "memory": 1,
- "runtime": "py38",
- "runtimeVersion": "Python 3.8.13",
- "error": {
- "code": 400,
- "message": "Could not build function."
}
}
Retrieve functions by ids.
project required | string Example: publicdata The project name. |
required | Array of FunctionId (object) or FunctionExternalId (object) (FunctionIdEither) [ 1 .. 10 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "createdTime": 123455234,
- "status": "Queued",
- "name": "myfunction",
- "externalId": "my.known.id",
- "fileId": 1,
- "owner": "user@cognite.com",
- "description": "My fantastic function with advanced ML",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "apiKey": "***",
- "secrets": {
- "MySecret": "***"
}, - "functionPath": "myfunction/handler.py",
- "envVars": {
- "MyKey": "MyValue"
}, - "cpu": 0.25,
- "memory": 1,
- "runtime": "py38",
- "runtimeVersion": "Python 3.8.13",
- "error": {
- "code": 400,
- "message": "Could not build function."
}
}
]
}
Activate Cognite Functions. This will create the necessary backend infrastructure for Cognite Functions.
project required | string Example: publicdata The project name. |
{- "status": "inactive"
}
Perform a function call. To provide input data to the function, add the data in an object called data
in the request body. It will be available as the data
argument into the function. Info about the function call at runtime can be obtained through the function_call_info
argument if added in the function handle. WARNING: Secrets or other confidential information should not be passed via the data
object. There is a dedicated secrets
object in the request body to "Create functions" for this purpose.
project required | string Example: publicdata The project name. |
functionId required | integer The function id. |
data | object (data) Input data to the function. This data is passed deserialized into the function through one of the arguments called |
nonce | string (nonce) Nonce retrieved from sessions API when creating a session. This will be used to bind the session before executing the function. The corresponding access token will be passed to the function and used to instantiate the client of the handle() function. You can create a session via the Sessions API. When using the Python SDK, the session will be created behind the scenes when creating the schedule. |
{- "data": {
- "timeSeriesId1": 13435351,
- "maxValue": 4
}, - "nonce": "string"
}
{- "id": 1,
- "status": "Running",
- "startTime": 0,
- "endTime": 0,
- "error": {
- "trace": "Cannot assign foo to bar.",
- "message": "Could not authenticate."
}, - "scheduleId": 1,
- "functionId": 1,
- "scheduledTime": 0
}
List function calls.
project required | string Example: publicdata The project name. |
functionId required | integer The function id. |
limit | integer >= 1 Default: 100 Limits the number of results to be returned. |
cursor | string Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo Cursor for paging through results. |
logs = client.functions.calls.get_logs(call_id=2, function_id=1) client.ll = client.functions.calls.retrieve(call_id=2, function_id=1) logs = client.ll.get_logs()
{- "items": [
- {
- "id": 1,
- "status": "Running",
- "startTime": 0,
- "endTime": 0,
- "error": {
- "trace": "Cannot assign foo to bar.",
- "message": "Could not authenticate."
}, - "scheduleId": 1,
- "functionId": 1,
- "scheduledTime": 0
}
], - "nextCursor": "string"
}
Retrieve function calls by call ids.
project required | string Example: publicdata The project name. |
functionId required | integer The function id. |
List of IDs of calls to retrieve. Must be up to a maximum of 10000 items and all of them must be unique.
required | Array of objects (FunctionCallId) [ 1 .. 10000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "status": "Running",
- "startTime": 0,
- "endTime": 0,
- "error": {
- "trace": "Cannot assign foo to bar.",
- "message": "Could not authenticate."
}, - "scheduleId": 1,
- "functionId": 1,
- "scheduledTime": 0
}
]
}
Retrieve function calls.
project required | string Example: publicdata The project name. |
callId required | integer The function call id. |
functionId required | integer The function id. |
{- "id": 1,
- "status": "Running",
- "startTime": 0,
- "endTime": 0,
- "error": {
- "trace": "Cannot assign foo to bar.",
- "message": "Could not authenticate."
}, - "scheduleId": 1,
- "functionId": 1,
- "scheduledTime": 0
}
Get logs from a function call.
project required | string Example: publicdata The project name. |
callId required | integer The function call id. |
functionId required | integer The function id. |
{- "items": [
- {
- "timestamp": 1585350274000,
- "message": "Did do fancy thing"
}, - {
- "timestamp": 1585350276000,
- "message": "Did do another fancy thing"
}
]
}
Retrieve response from a function call.
project required | string Example: publicdata The project name. |
callId required | integer The function call id. |
functionId required | integer The function id. |
response = client.functions.calls.get_response(call_id=2, function_id=1) client.ll = client.functions.calls.retrieve(call_id=2, function_id=1) response = client.ll.get_response()
{- "response": {
- "numAssets": 1234,
- "someCalculation": 3.14
}
}
Use advanced filtering options to find function calls.
project required | string Example: publicdata The project name. |
functionId required | integer The function id. |
object (FunctionCallFilter) | |
limit | integer <int32> >= 1 Default: 100 Limits the number of results to be returned. |
cursor | string |
{- "filter": {
- "status": "Running",
- "scheduleId": 123,
- "startTime": {
- "min": 1234,
- "max": 5678
}
}, - "limit": 10
}
{- "items": [
- {
- "id": 1,
- "status": "Running",
- "startTime": 0,
- "endTime": 0,
- "error": {
- "trace": "Cannot assign foo to bar.",
- "message": "Could not authenticate."
}, - "scheduleId": 1,
- "functionId": 1,
- "scheduledTime": 0
}
], - "nextCursor": "string"
}
Function schedules allow you to run functions with a specific input at intervals defined by a cron expression. These function calls will be asynchronous and show up in the function call list. Visit http://www.cronmaker.com to generate a cron expression with a UI.
List function schedules in project.
project required | string Example: publicdata The project name. |
limit | integer >= 1 Default: 100 Limits the number of results to be returned. |
{- "items": [
- {
- "id": 1,
- "name": "My schedule",
- "createdTime": 0,
- "description": "This is a nice schedule",
- "cronExpression": "* * * * *",
- "when": "Every hour",
- "functionId": 1,
- "functionExternalId": "my.known.id",
- "sessionId": "string"
}
]
}
Create function schedules. Function schedules trigger asynchronous calls with specific input data, based on a cron expression that determines when these triggers should be fired. Use e.g. http://www.cronmaker.com to be guided on how to generate a cron expression. One of FunctionId
or FunctionExternalId
(deprecated) must be set (but not both). When creating a schedule with a session, i.e. with a nonce
, FunctionId
must be used. The nonce
will be used to bind the session before function execution, and the session will be kept alive for the lifetime of the schedule. WARNING: Secrets or other confidential information should not be passed via the data
object. There is a dedicated secrets
object in the request body to "Create functions" for this purpose.
project required | string Example: publicdata The project name. |
required | Array of objects (FunctionSchedule) = 1 items |
{- "items": [
- {
- "name": "My schedule",
- "description": "This is a nice schedule",
- "cronExpression": "* * * * *",
- "when": "Every hour",
- "functionId": 1,
- "functionExternalId": "my.known.id",
- "sessionId": "string",
- "data": {
- "timeSeriesId1": 13435351,
- "maxValue": 4
}, - "nonce": "string"
}
]
}
{- "items": [
- {
- "id": 1,
- "name": "My schedule",
- "createdTime": 0,
- "description": "This is a nice schedule",
- "cronExpression": "* * * * *",
- "when": "Every hour",
- "functionId": 1,
- "functionExternalId": "my.known.id",
- "sessionId": "string"
}
]
}
Use advanced filtering options to find function schedules. At most one of FunctionId
or FunctionExternalId
can be specified.
project required | string Example: publicdata The project name. |
object (FunctionScheduleFilter) | |
limit | integer <int32> >= 1 Default: 100 Limits the number of results to be returned. |
{- "filter": {
- "name": "MySchedule",
- "cronExpression": "5 4 * * *"
}
}
{- "items": [
- {
- "id": 1,
- "name": "My schedule",
- "createdTime": 0,
- "description": "This is a nice schedule",
- "cronExpression": "* * * * *",
- "when": "Every hour",
- "functionId": 1,
- "functionExternalId": "my.known.id",
- "sessionId": "string"
}
]
}
Retrieve a function schedule by its id.
project required | string Example: publicdata The project name. |
scheduleId required | integer The function schedule id. |
{- "id": 1,
- "name": "My schedule",
- "createdTime": 0,
- "description": "This is a nice schedule",
- "cronExpression": "* * * * *",
- "when": "Every hour",
- "functionId": 1,
- "functionExternalId": "my.known.id",
- "sessionId": "string"
}
Retrieve function schedules by schedule ids.
project required | string Example: publicdata The project name. |
List of IDs of schedules to retrieve. Must be up to a maximum of 10000 items and all of them must be unique.
required | Array of objects [ 1 .. 10000 ] items |
ignoreUnknownIds | boolean Default: false Ignore IDs and external IDs that are not found |
{- "items": [
- {
- "id": 1
}
], - "ignoreUnknownIds": false
}
{- "items": [
- {
- "id": 1,
- "name": "My schedule",
- "createdTime": 0,
- "description": "This is a nice schedule",
- "cronExpression": "* * * * *",
- "when": "Every hour",
- "functionId": 1,
- "functionExternalId": "my.known.id",
- "sessionId": "string"
}
]
}
Delete function schedules.
project required | string Example: publicdata The project name. |
required | Array of objects (FunctionScheduleId) [ 1 .. 10000 ] items |
{- "items": [
- {
- "id": 1
}
]
}
{ }
Retrieve the input data to the associated function.
project required | string Example: publicdata The project name. |
scheduleId required | integer The function schedule id. |
client.functions.schedules.get_input_data(id = 123)
{- "id": 1,
- "data": {
- "timeSeriesId1": 13435351,
- "maxValue": 4
}
}