Entity Relationships (Beta)

Use these operations to interact with entity relationships in Cortex.

Required permissions

Create and Update Relationships: Your API key must have the Edit entities permission. Your tenant must also have the Entity relationships feature enabled.

Operations

List entity destinations for a relationship type

get

List all entity destinations for a certain relationship type. Optional depth parameter to limit the depth of the relationship tree.

Authorizations
Path parameters
tagOrIdstringRequired

The tag (x-cortex-tag) or unique, auto-generated identifier for the entity.

relationshipTypeTagstringRequired
Query parameters
depthstringOptional

How many relationships to traverse the relationship tree. Defaults to immediate relationships

includeArchivedbooleanOptional

If true will include relationships that traverse archived entities

Default: false
Responses
200
Successfully retrieved entity sources
application/json
get
GET /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/destinations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
  "destinations": [
    {
      "description": "text",
      "id": "en2da8159dbeefb974",
      "name": "My Favorite Entity",
      "tag": "my-favorite-entity",
      "type": "service"
    }
  ]
}

Update direct entity destinations for a given entity

put

Update all direct destinations for a given entity and entity relationship type

Authorizations
Path parameters
tagOrIdstringRequired

The tag (x-cortex-tag) or unique, auto-generated identifier for the entity.

relationshipTypeTagstringRequired
Query parameters
forcebooleanOptional

When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.

Body

Updates to entity relationship destinations

destinationsstring[]Required

List of code tags for the entities to add as sources

Example: ["entity-1","entity-2"]
Responses
200
Successfully updated entity destinations
application/json
put
PUT /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/destinations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "destinations": [
    "entity-1",
    "entity-2"
  ]
}
{
  "destinations": [
    {
      "description": "text",
      "id": "en2da8159dbeefb974",
      "name": "My Favorite Entity",
      "tag": "my-favorite-entity",
      "type": "service"
    }
  ]
}

Add direct entity destinations for a given entity

post

Add direct destinations for a given entity and entity relationship type

Authorizations
Path parameters
tagOrIdstringRequired

The tag (x-cortex-tag) or unique, auto-generated identifier for the entity.

relationshipTypeTagstringRequired
Query parameters
forcebooleanOptional

When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.

Body

Updates to entity relationship destinations

destinationsstring[]Required

List of code tags for the entities to add as sources

Example: ["entity-1","entity-2"]
Responses
200
Successfully added entity destinations
application/json
post
POST /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/destinations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "destinations": [
    "entity-1",
    "entity-2"
  ]
}
{
  "destinations": [
    {
      "description": "text",
      "id": "en2da8159dbeefb974",
      "name": "My Favorite Entity",
      "tag": "my-favorite-entity",
      "type": "service"
    }
  ]
}

List entity sources for a relationship type

get

List all entity sources for a certain relationship type. Optional depth parameter to limit the depth of the relationship tree.

Authorizations
Path parameters
tagOrIdstringRequired

The tag (x-cortex-tag) or unique, auto-generated identifier for the entity.

relationshipTypeTagstringRequired
Query parameters
depthstringOptional

How many relationships to traverse the relationship tree. Defaults to immediate relationships

includeArchivedbooleanOptional

If true will include relationships that traverse archived entities

Default: false
Responses
200
Successfully retrieved entity sources
application/json
get
GET /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/sources HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
  "sources": [
    {
      "description": "text",
      "id": "en2da8159dbeefb974",
      "name": "My Favorite Entity",
      "tag": "my-favorite-entity",
      "type": "service"
    }
  ]
}

Update direct entity sources for a given entity

put

Update all direct sources for a given entity and entity relationship type

Authorizations
Path parameters
tagOrIdstringRequired

The tag (x-cortex-tag) or unique, auto-generated identifier for the entity.

relationshipTypeTagstringRequired
Query parameters
forcebooleanOptional

When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.

Body

Updates to entity relationship sources

sourcesstring[]Required

List of code tags for the entities to add as sources

Example: ["entity-1","entity-2"]
Responses
200
Successfully updated entity sources
application/json
put
PUT /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/sources HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 35

{
  "sources": [
    "entity-1",
    "entity-2"
  ]
}
{
  "sources": [
    {
      "description": "text",
      "id": "en2da8159dbeefb974",
      "name": "My Favorite Entity",
      "tag": "my-favorite-entity",
      "type": "service"
    }
  ]
}

Add direct entity sources for a given entity

post

Add direct sources for a given entity and entity relationship type

Authorizations
Path parameters
tagOrIdstringRequired

The tag (x-cortex-tag) or unique, auto-generated identifier for the entity.

relationshipTypeTagstringRequired
Query parameters
forcebooleanOptional

When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.

Body

Updates to entity relationship sources

sourcesstring[]Required

List of code tags for the entities to add as sources

Example: ["entity-1","entity-2"]
Responses
200
Successfully added entity sources
application/json
post
POST /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/sources HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 35

{
  "sources": [
    "entity-1",
    "entity-2"
  ]
}
{
  "sources": [
    {
      "description": "text",
      "id": "en2da8159dbeefb974",
      "name": "My Favorite Entity",
      "tag": "my-favorite-entity",
      "type": "service"
    }
  ]
}

List entity relationships for a relationship type

get

List all entity relationships for a certain relationship type.

Authorizations
Path parameters
relationshipTypeTagstringRequired
Query parameters
pageSizeinteger · int32Required

Number of results to return per page, between 1 and 1000. Default 250.

Default: 250
pageinteger · int32Required

Page number to return, 0-indexed. Default 0.

Default: 0
Responses
200
Successfully retrieved entity relationships
application/json
get
GET /api/v1/relationships/{relationshipTypeTag} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
  "page": 1,
  "relationships": [
    {
      "destinationEntity": {
        "description": "text",
        "id": "en2da8159dbeefb974",
        "name": "My Favorite Entity",
        "tag": "my-favorite-entity",
        "type": "service"
      },
      "providerType": "WORKDAY",
      "relationshipTypeTag": "text",
      "sourceEntity": {
        "description": "text",
        "id": "en2da8159dbeefb974",
        "name": "My Favorite Entity",
        "tag": "my-favorite-entity",
        "type": "service"
      }
    }
  ],
  "total": 1,
  "totalPages": 1
}

Update entity relationships for a relationship type

put

Update all entity relationships for a certain relationship type.

Authorizations
Path parameters
relationshipTypeTagstringRequired
Query parameters
forcebooleanOptional

When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.

Body

Updates to entity relationships

Responses
200
Successfully updated entity relationships
application/json
put
PUT /api/v1/relationships/{relationshipTypeTag} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 58

{
  "relationships": [
    {
      "destination": "text",
      "source": "text"
    }
  ]
}
{
  "errors": [
    {
      "destinationEntityTag": "text",
      "errorMessage": "text",
      "relationshipTypeTag": "text",
      "sourceEntityTag": "text"
    }
  ],
  "relationships": [
    {
      "destinationEntityTag": "text",
      "providerType": "WORKDAY",
      "relationshipTypeTag": "text",
      "sourceEntityTag": "text"
    }
  ]
}

Add entity relationships for a relationship type

post

Add all entity relationships for a certain relationship type.

Authorizations
Path parameters
relationshipTypeTagstringRequired
Query parameters
forcebooleanOptional

When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.

Body

Updates to entity relationships

Responses
200
Successfully added entity relationships
application/json
post
POST /api/v1/relationships/{relationshipTypeTag} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 58

{
  "relationships": [
    {
      "destination": "text",
      "source": "text"
    }
  ]
}
{
  "errors": [
    {
      "destinationEntityTag": "text",
      "errorMessage": "text",
      "relationshipTypeTag": "text",
      "sourceEntityTag": "text"
    }
  ],
  "relationships": [
    {
      "destinationEntityTag": "text",
      "providerType": "WORKDAY",
      "relationshipTypeTag": "text",
      "sourceEntityTag": "text"
    }
  ]
}

Last updated

Was this helpful?