How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Cognite Relationships API

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.

Cognite Relationships API is one of 90 APIs that Cognite publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Relationships. The published artifact set on APIs.io includes an OpenAPI specification.

This API exposes 6 operations across 5 paths, and defines 115 schemas. It is described by OpenAPI 3.2.0, at version v1.

Requests are made against a single base URL, https://{cluster}.cognitedata.com/api/v1/projects/{project}.

6 operations 5 paths 115 schemas 1 GET5 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
v1
Base URL
https://api.cognitedata.com
Authentication
HTTP Bearer, OAuth 2.0, OAuth 2.0, OAuth 2.0, OpenID Connect
Resource Areas
1

Authentication & Security 5

Cognite Relationships API declares 5 security schemes for authenticating requests. It accepts HTTP bearer tokens (OpenID Connect or OAuth2 token) (oidc-token). It supports OAuth 2.0 (oauth2-client-credentials) using the clientCredentials flow, exposing 1 scope. It supports OAuth 2.0 (oauth2-auth-code) using the authorizationCode flow, exposing 1 scope. It supports OAuth 2.0 (oauth2-open-industrial-data) using the clientCredentials flow, exposing 1 scope. It supports OpenID Connect (org-oidc-token) discovered at https://auth.cognite.com/.well-known/openid-configuration. By default, every request must be authenticated.

  • oidc-token — Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to acce…
  • oauth2-client-credentials — Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to acce…
  • oauth2-auth-code — Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to acce…
  • oauth2-open-industrial-data — Auth flow for Open Industrial Data. Get your client secret from https://hub.cognite.com/open-industrial-data-211.
  • org-oidc-token — Access token issued by the Cognite authorization server, and valid for the target organization. The token must be an OpenID Connect token, and it can be obtain…

Paths & Operations 6

Across 5 paths, the API surfaces 6 operations — 1 GET, 5 POST. Each is listed below with its method, path, parameters, and response codes.

Relationships 6

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…

POST
/relationships
Create relationships
createRelationships body → 201400409500
GET
/relationships
List relationships
getRelationships 3 params → 200500
POST
/relationships/update
Update relationships
updateRelationships body → 200400409
POST
/relationships/delete
Delete relationships
deleteRelationships body → 202409500
POST
/relationships/byids
Retrieve relationships
byidsRelationships body → 200400409
POST
/relationships/list
Filter relationships
listRelationships body → 200400409

Schemas 115

The contract defines 115 schemas that model the data the API accepts and returns. The most detailed are GetTimeSeriesMetadataDTO (16 properties), ExternalFilesMetadata (13 properties), advancedListFilter (13 properties), relationship (10 properties). Each schema is shown below with its type and property counts.

Label
object
A label assigned to a resource.
1 property 1 required
DataSetIdEither
MultiLineString
object
2 properties 2 required
AssetMetadata
object
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…
startTime
The time, in milliseconds since Jan. 1, 1970, when the relationship became active. If there is no startTime, the relationship is active from the beginning of t…
relationshipsAdvancedListRequest
object
5 properties
EventSubType
string
SubType of the event, e.g 'electrical'.
ignoreUnknownIds
boolean
Ignore external IDs that are not found.
resourceReferenceWithExternalId
object
2 properties 2 required
PointCoordinates
array
Coordinates of a point in 2D space, described as an array of 2 numbers. Example: [4.306640625, 60.205710352530346]
EventType
string
Type of the event, e.g 'failure'.
Event
CogniteInternalId
integer
A server-generated ID for the object.
deleteRequest
object
2 properties 1 required
FilesMetadata
sourceExternalId
The external ID of the resource that is the relationship source.
InstanceSpace
string
FileName
string
Name of the file.
updateDataSetId
object
Set a new value for the dataSet Ids, or remove the value.
updateStartTime
object
Set a new value for the start time, or remove the value.
LabelsPatch
Updates the resource's assigned labels. Labels can be added, removed or replaced (set). Adding an already attached label is an idempotent operation. Removing a…
Point
object
2 properties 2 required
MultiPolygonCoordinates
array
List of multiple polygons. Each polygon is defined as a list of one or more linear rings representing a shape. A linear ring is the boundary of a surface or th…
TimeSeriesMetadata
object
Custom, application specific metadata. String key - String value. Maximum length of key is 128 bytes, up to 256 key-value pairs, of total size of at most 10000…
GeoLocationGeometry
object
Represents the points, curves and surfaces in the coordinate space.
1 required
updateConfidence
object
Set a new value for the confidence, or remove the value.
byIdsRequest
object
3 properties 1 required
FilesMetadataField
object
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…
cursorObject
object
1 property
EpochTimestamp
integer
The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
MultiPoint
object
2 properties 2 required
AssetSource
string
The source of the asset.
Polygon
object
2 properties 2 required
confidence
number
Confidence value of the existence of the relationship. Generated relationships provide a score of the likelihood of the relationship existing. Relationships wi…
enrichedRelationshipResponse
object
SequenceValueTypeEnum
string
What type the datapoints in a column will have. DOUBLE is restricted to the range [-1E100, 1E100]
InternalEvent
object
An event represents something that happened at a given interval in time, for example, a failure, a work order, etc.
10 properties
externalIdObject
object
1 property 1 required
relationshipResponseWrapper
object
1 property 1 required
relationshipUpdate
object
2 properties 2 required
dataSetId
The ID of the dataset the relationship belongs to.
CogniteExternalId
string
The external ID provided by the client. Must be unique for the resource type.
GetSequenceDTO
object
Information about the sequence stored in the database.
10 properties 4 required
Limit
object
1 property
setConfidence
object
1 property 1 required
setDataSetId
object
1 property 1 required
DataSetId
integer
The dataSet Id for the item.
ExternalFilesMetadata
object
13 properties 1 required
sourceType
The resource type of the relationship source. Must be one of the specified values.
Asset
LabelList
array
A list of the labels associated with this resource item.
Cursor
object
1 property
relationshipUpdateContent
object
9 properties
MultiPointCoordinates
array
List of Points. Each Point is defined as an array of 2 numbers, representing coordinates of a point in 2D space. Example: [[35, 10], [45, 45]]
DataSetExternalId
object
1 property 1 required
CogniteInstanceId
object
The ID of an [instance in Cognite Data Models](https://docs.cognite.com/cdf/dm/dmconcepts/dmspacesinstancesinstance).
2 properties 2 required
enrichedRelationshipResponseWrapper
object
1 property 1 required
LabelContainsAllFilter
object
1 property 1 required
pagedEnrichedRelationshipResponseWrapper
object
Partition
string
Splits the data set into N partitions. The attribute is specified as a "M/N" string, where M is a natural number in the interval of [1, N]. You need to follow…
advancedListFilter
object
Filter on relationships with exact match. Multiple filter elements in one property, for example sourceExternalIds: [ "a", "b" ], returns all relationships wher…
13 properties
endTime
The time, in milliseconds since Jan. 1, 1970, when the relationship became inactive. If there is no endTime, the relationship is active from startTime until th…
fetchResources
boolean
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…
LabelFilter
Return only the resource matching the specified label constraints.
RemoveField
object
1 property 1 required
PolygonCoordinates
array
List of one or more linear rings representing a shape. A linear ring is the boundary of a surface or the boundary of a hole in a surface. It is defined as a li…
AssetIdentifier
object
1 property 1 required
DataSetInternalId
object
1 property 1 required
resourceType
string
updateEndTime
object
persistedObject
object
3 properties 3 required
InstanceId
object
2 properties 2 required
itemsArray
array
relationshipExternalId
string
The external ID of the relationship.
ExternalAsset
object
A representation of a physical asset, for example a factory or a piece of equipment.
10 properties 1 required
resourceExternalId
string
TimeSeriesType
string
The type of the time series. Currently, time series can either be of type numeric or string. The available types of time series may be extended in the future.
floatRange
object
Range to filter the field for (inclusive).
2 properties
LabelsAddRemove
object
2 properties
AssetDescription
string
The description of the asset.
LabelsSet
object
1 property
LineStringCoordinates
array
Coordinates of a line described by a list of two or more points. Each point is defined as a pair of two numbers in an array, representing coordinates of a poin…
updateRelationshipWrapper
object
1 property 1 required
updateSourceExternalId
object
Set a new value for the relationship source external ID.
1 property 1 required
AggregateResultItem
object
Aggregated metrics of the asset.
3 properties
updateSourceType
object
Set a new value for the relationship source type.
1 property 1 required
GetTimeSeriesMetadataDTO
object
16 properties 6 required
FileSource
string
The source of the file.
MultiLineStringCoordinates
array
List of lines where each line (LineString) is defined as a list of two or more points. Each point is defined as a pair of two numbers in an array, representing…
relationshipResponse
object
updateTargetType
object
Set a new value for the relationship target type.
1 property 1 required
enrichedRelationship
object
2 properties
generalError
object
Cognite API error
4 properties 2 required
LineString
object
2 properties 2 required
setEndTime
object
1 property 1 required
setStartTime
object
1 property 1 required
GeoLocation
object
Geographic metadata.
3 properties 2 required
FileDirectory
string
Directory containing the file. Must be an absolute, unix-style path.
InternalId
object
1 property 1 required
generalErrorWrapper
object
Error wrapper Error message
1 property 1 required
targetType
The resource type of the relationship target. Must be one of the specified values.
MultiPolygon
object
2 properties 2 required
LabelContainsAnyFilter
object
1 property 1 required
AssetInternalId
object
1 property 1 required
updateTargetExternalId
object
Set a new value for the relationship target external ID.
1 property 1 required
InstanceExternalId
string
targetExternalId
The external ID of the resource that is the relationship target.
MimeType
string
File type. E.g. text/plain, application/pdf, ..
EventMetadata
object
Custom, application specific metadata. String key - String value. Limits: Maximum length of key is 128 bytes, value 128000 bytes, up to 256 key-value pairs, of…
relationship
object
The representation of a relationship consists of a source and a target and additional parameters.
10 properties 5 required
EpochTimestampRange
object
Range between two timestamps (inclusive).
2 properties
GetSequenceColumnDTO
object
Information about a column stored in the database.
7 properties 4 required
AssetName
string
The name of the asset.
relationshipRequestWrapper
object
1 property 1 required
pagedRelationshipResponseWrapper
object

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

cognite-relationships-api-openapi.yml Raw ↑

Other APIs Cognite publishes across the network.

Cognite Data Fusion API
Cognite 3D Asset Mapping API
Cognite 3D Files API
Cognite 3D Jobs API
Cognite 3D Model Revisions API
Cognite 3D Models API
Cognite Annotations API
Cognite Assets API
Cognite Connections API
Cognite Containers API
Cognite Data models API
Cognite Data point subscriptions API
Where this information came from

This is an independent, third-party profile of Cognite Relationships API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.