Unify and manage your data

Get relations between two objects

Learn how to retrieve relationships between two entities.

This operation fetches all relations between two entities filtered by relationTypes.

Note: If you omit relationTypes from the request, the operation returns all relations.

Request

POST {TenantURL}/relations/getByObjectUris
Table 1. Parameters
ParameterRequiredDetails
HeadersAuthorization Yes Information about authentication access token in format "Bearer <accessToken>" (see details in Authentication API ).
QueryoptionsNoComma-separated list of options which affect relation's JSON content in the response. Available options:
  • sendHidden- disabled by default, response contains hidden attributes if this option is enabled.
  • resolveMergedEntities- false by default, returns actual winner URIs for start/end objects in the relation if true.
BodyYesJSON object specifying relation filter criteria. This object supports the following fields:
  • objectUris (required): JSON array of exactly two entity URIs. Specifies the entities whose relations you want to retrieve.
  • relationTypes (optional): JSON array of relation type URIs. Filters the response by relation type. If omitted, all relations are returned.

Example

This example shows how to retrieve a HasAddress relation between two entities.

Request
POST {TenantURL}/relations/getByObjectUris
Headers: Authorization: Bearer ...
{
  "objectUris": [
    "entities/0000Dqr",
    "entities/00009ab"
  ],
  "relationTypes": [
    "configuration/relationTypes/HasAddress"
  ]
}
Response
[
    {
        "index": 0,
        "object": {
            "uri": "relations/0000Aef",
            "type": "configuration/relationTypes/HasAddress",
            "startObject": {
                "objectURI": "entities/0000Dqr",
                "uri": "relations/0000Aef/startObject",
                "type": "configuration/entityTypes/HCP",
                "label": "Other  Person",
                "directionalLabel": "has address"
            },
            "endObject": {
                "objectURI": "entities/00009ab",
                "uri": "relations/0000Aef/endObject",
                "type": "configuration/entityTypes/Location",
                "label": "2501 N Orange Ave Ste 589   ",
                "directionalLabel": "locates"
            },
            "attributes": {},
            "crosswalks": [
                {
                    "uri": "relations/0000Aef/crosswalks/18D",
                    "type": "configuration/sources/LNKD",
                    "value": "123",
                    "createDate": "2025-01-28T20:24:34.625+04:00",
                    "updateDate": "2025-01-28T20:24:34.625+04:00",
                    "attributes": [],
                    "singleAttributeUpdateDates": {}
                }
            ],
            "ratings": [
                {
                    "userRoles": "ROLE_ADMIN,ROLE_API,ROLE_USER",
                    "comment": "BAD",
                    "value": 1,
                    "timestamp": "2025-01-28T20:30:56.253+0400",
                    "user": "masha"
                }
            ],
            "consolidatedRating": 1
        },
        "successful": true
    }
]