const relationships = [
{
externalId: 'some_relationship',
sourceExternalId: 'some_source_external_id',
sourceType: 'asset' as const,
targetExternalId: 'some_target_external_id',
targetType: 'event' as const
}
];
const createdRelationships = await client.relationships.create(relationships);{
"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"
}
]
}
]
}Required capabilities:
relationshipsAcl:WRITE
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.
const relationships = [
{
externalId: 'some_relationship',
sourceExternalId: 'some_source_external_id',
sourceType: 'asset' as const,
targetExternalId: 'some_target_external_id',
targetType: 'event' as const
}
];
const createdRelationships = await client.relationships.create(relationships);{
"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"
}
]
}
]
}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.
Data required to create relationships. You can request a maximum of 1000 relationships per request.
1 - 1000 elementsShow child attributes
Relationships stored by CDF.
1 - 1000 elementsShow child attributes
Was this page helpful?