Skip to main content
POST
/
relationships
/
update
Python SDK
rel = client.relationships.retrieve(external_id="flow1")
rel.confidence = 0.75
res = client.relationships.update(rel)

from cognite.client.data_classes import RelationshipUpdate
my_update = RelationshipUpdate(external_id="flow_1").source_external_id.set("alternate_source").confidence.set(0.97)
res1 = client.relationships.update(my_update)
another_update = RelationshipUpdate(external_id="flow_1").confidence.set(None)
res2 = client.relationships.update(another_update)

from cognite.client.data_classes import RelationshipUpdate
my_update = RelationshipUpdate(external_id="flow_1").labels.add(["PUMP", "VERIFIED"])
res = client.relationships.update(my_update)

from cognite.client.data_classes import RelationshipUpdate
my_update = RelationshipUpdate(external_id="flow_1").labels.remove("PUMP")
res = client.relationships.update(my_update)
{
  "items": [
    {
      "externalId": "<string>",
      "sourceExternalId": "<string>",
      "sourceType": "asset",
      "targetExternalId": "<string>",
      "targetType": "asset",
      "createdTime": 1730204346000,
      "lastUpdatedTime": 1730204346000,
      "startTime": 1730204346000,
      "endTime": 1730204346000,
      "confidence": 0.5,
      "dataSetId": 4503599627370496,
      "labels": [
        {
          "externalId": "my.known.id"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

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 accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Body

application/json

Data required to update relationships.

items
object[]
required
Required array length: 1 - 1000 elements

Response

Relationships stored by CDF.

items
object[]
required
Required array length: 1 - 1000 elements
Last modified on April 23, 2026