Skip to main content
POST
/
relationships
/
byids
JavaScript SDK
const relationships = await client.relationships.retrieve([{externalId: 'abc'}, {externalId: 'def'}]);
{
  "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"
        }
      ],
      "source": {
        "createdTime": 1730204346000,
        "lastUpdatedTime": 1730204346000,
        "rootId": 4503599627370496,
        "name": "<string>",
        "id": 4503599627370496,
        "aggregates": {
          "childCount": 1,
          "depth": 1,
          "path": [
            {
              "id": 4503599627370496
            }
          ]
        },
        "parentId": 4503599627370496,
        "parentExternalId": "my.known.id",
        "externalId": "my.known.id",
        "description": "<string>",
        "dataSetId": 4503599627370496,
        "metadata": {},
        "source": "<string>",
        "labels": [
          {
            "externalId": "my.known.id"
          }
        ],
        "geoLocation": {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [
              123
            ]
          },
          "properties": {}
        }
      },
      "target": {
        "createdTime": 1730204346000,
        "lastUpdatedTime": 1730204346000,
        "rootId": 4503599627370496,
        "name": "<string>",
        "id": 4503599627370496,
        "aggregates": {
          "childCount": 1,
          "depth": 1,
          "path": [
            {
              "id": 4503599627370496
            }
          ]
        },
        "parentId": 4503599627370496,
        "parentExternalId": "my.known.id",
        "externalId": "my.known.id",
        "description": "<string>",
        "dataSetId": 4503599627370496,
        "metadata": {},
        "source": "<string>",
        "labels": [
          {
            "externalId": "my.known.id"
          }
        ],
        "geoLocation": {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [
              123
            ]
          },
          "properties": {}
        }
      }
    }
  ]
}

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 list relationships.

items
object[]
required
Required array length: 1 - 1000 elements
ignoreUnknownIds
boolean
default:false

Ignore external IDs that are not found.

fetchResources
boolean
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.

Response

Relationships stored by CDF.

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