---
updatedAt: 2026-09-04T05:36:48.000Z
agentTools:
  projectIndex: https://developer.intellistack.com/llms.txt
---

# List relationship substitution candidates

Answers "what can this link be reconnected to?" for one dataset. Candidates are drawn from the relationships adjacent to the dataset's traversal-route entities — every one of them, including entities that appear only inside a nested route — and then narrowed to those the substitution save path would accept, so a candidate offered here cannot be rejected on save.

Resilient by design: an entity that can no longer be read is reported in `unreachableEntities` and the candidates from every other entity are still returned, rather than the whole request failing on one deleted entity. The exception is an entity the broken step itself joins — no replacement for the step can be saved while one of its endpoints is gone, so the candidate list is empty and the entity to repair first is named in `unreachableEntities`.

Only substitutions already saved are taken into account. Entity substitutions still unsaved in the caller's editing session are invisible here, so a reconnect flow that remaps an entity and then asks which links it can use should save the entity substitution first — otherwise the deleted entity is still reported as unreachable and no candidate is offered for a step it joins.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "DataSetRelationshipSubstitutionCandidate": {
        "properties": {
          "linkId": {
            "format": "uuid",
            "type": "string"
          },
          "reversibleReads": {
            "description": "Whether the catalog can read this relationship against its own direction.",
            "type": "boolean"
          },
          "sourceCardinality": {
            "$ref": "#/components/schemas/NodeRelationshipCardinality"
          },
          "sourceEntityId": {
            "description": "The relationship's own source, which is not necessarily the entity the step reads from.",
            "format": "uuid",
            "type": "string"
          },
          "targetCardinality": {
            "$ref": "#/components/schemas/NodeRelationshipCardinality"
          },
          "targetEntityId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "linkId",
          "sourceEntityId",
          "targetEntityId",
          "reversibleReads"
        ],
        "type": "object"
      },
      "DataSetRelationshipSubstitutionCandidates": {
        "properties": {
          "candidates": {
            "description": "The acceptable replacements, ordered by link ID so repeated calls agree. Empty when nothing adjacent to the dataset's entities fits the broken step.",
            "items": {
              "$ref": "#/components/schemas/DataSetRelationshipSubstitutionCandidate"
            },
            "type": "array"
          },
          "datasetId": {
            "format": "uuid",
            "type": "string"
          },
          "linkId": {
            "description": "The relationship these candidates could replace.",
            "format": "uuid",
            "type": "string"
          },
          "unreachableEntities": {
            "description": "Traversal-route entities whose relationships could not be read, with the reason. Present so a caller can tell a genuinely empty candidate list from a partially answered one; the candidates from every other entity are still returned.",
            "items": {
              "$ref": "#/components/schemas/DataSetUnreachableEntity"
            },
            "type": "array"
          }
        },
        "required": [
          "datasetId",
          "linkId",
          "candidates",
          "unreachableEntities"
        ],
        "type": "object"
      },
      "DataSetUnreachableEntity": {
        "properties": {
          "entityId": {
            "format": "uuid",
            "type": "string"
          },
          "reason": {
            "description": "Why this entity contributed no candidates, in terms the caller can surface.",
            "type": "string"
          }
        },
        "required": [
          "entityId",
          "reason"
        ],
        "type": "object"
      },
      "ErrorDetails": {
        "description": "Details of an error",
        "properties": {
          "code": {
            "description": "Internal error code",
            "type": "string"
          },
          "detail": {
            "description": "Error details",
            "type": "string"
          },
          "sourceError": {
            "$ref": "#/components/schemas/ErrorDetails"
          },
          "title": {
            "description": "Error title",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorEnvelope": {
        "description": "Contains a list of errors",
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ErrorDetails"
            },
            "type": "array"
          },
          "message": {
            "description": "Top level message to describe the error",
            "type": "string"
          },
          "traceId": {
            "description": "Internal traceId",
            "type": "string"
          }
        },
        "type": "object"
      },
      "NodeRelationshipCardinality": {
        "description": "Defines the possible cardinality types for relationships.",
        "enum": [
          "ONE",
          "MANY",
          "UNKNOWN"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "Data Activation",
    "version": "0.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/activation/dataset/{dataSetId}/relationships/{linkId}/substitution-candidates": {
      "get": {
        "description": "Answers \"what can this link be reconnected to?\" for one dataset. Candidates are drawn from the relationships adjacent to the dataset's traversal-route entities — every one of them, including entities that appear only inside a nested route — and then narrowed to those the substitution save path would accept, so a candidate offered here cannot be rejected on save.\n\nResilient by design: an entity that can no longer be read is reported in `unreachableEntities` and the candidates from every other entity are still returned, rather than the whole request failing on one deleted entity. The exception is an entity the broken step itself joins — no replacement for the step can be saved while one of its endpoints is gone, so the candidate list is empty and the entity to repair first is named in `unreachableEntities`.\n\nOnly substitutions already saved are taken into account. Entity substitutions still unsaved in the caller's editing session are invisible here, so a reconnect flow that remaps an entity and then asks which links it can use should save the entity substitution first — otherwise the deleted entity is still reported as unreachable and no candidate is offered for a step it joins.",
        "operationId": "listDataSetRelationshipSubstitutionCandidatesV2",
        "parameters": [
          {
            "description": "The ID of the dataset",
            "in": "path",
            "name": "dataSetId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The relationship being replaced, as the dataset's traversal route stores it",
            "in": "path",
            "name": "linkId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataSetRelationshipSubstitutionCandidates"
                }
              }
            },
            "description": "The acceptable replacements, which may be empty — because nothing adjacent to the dataset's entities fits the broken step, or because an entity the step joins can no longer be read and has to be repaired before the link. `unreachableEntities` tells the two apart: an entity named there that the step joins is the one to repair first."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "This relationship is not one the dataset could substitute — its traversal route does not name it, no deletion issue covers it, and it has no substitution of its own to repoint — so there is nothing to reconnect."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Caller lacks the READ_DATASETS permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "No active dataset exists with this ID for the caller's organization."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List the relationships that could replace a broken link in this dataset",
        "tags": [
          "Dataset"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "US Production Server",
      "url": "https://api-us.streamline.intellistack.ai"
    },
    {
      "description": "Canada Production Server",
      "url": "https://api-ca.streamline.intellistack.ai"
    }
  ],
  "tags": [
    {
      "description": "v2 Data set related endpoints",
      "name": "Dataset"
    }
  ]
}
```