{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-navigate-knowledge-graph-response-schema-schema.json",
  "title": "NavigateKnowledgeGraphResponseSchema",
  "description": "Response returned by GET /connectors/navigate.\n\nField names are snake_case, matching the knowledge graph's internal\nview models. `text` carries the same flat-text rendering PipesHub's\nown agent sees for this node; the remaining fields carry the same\ninformation in structured form.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-connector-api-openapi.yml#/components/schemas/NavigateKnowledgeGraphResponseSchema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "current",
    "breadcrumbs",
    "rows",
    "related",
    "pagination",
    "web_url",
    "indexing_status",
    "connector",
    "text"
  ],
  "properties": {
    "current": {
      "allOf": [
        {
          "$ref": "#/$defs/KnowledgeGraphNodeRefSchema"
        }
      ],
      "description": "The node that was opened. Null at the root listing."
    },
    "breadcrumbs": {
      "type": "array",
      "description": "Root to parent, not including `current`.",
      "items": {
        "$ref": "#/$defs/KnowledgeGraphNodeRefSchema"
      }
    },
    "rows": {
      "type": "array",
      "description": "The current node's children for this page. With `depth` > 1 this is a flat list of all descendants up to that depth, each row carrying its own `level`.",
      "items": {
        "$ref": "#/$defs/KnowledgeGraphNodeRowSchema"
      }
    },
    "related": {
      "type": "array",
      "description": "Cross-referenced records (non-containment edges), e.g. the Confluence page linked from a Jira ticket. Page 1 only.",
      "items": {
        "$ref": "#/$defs/KnowledgeGraphNodeRowSchema"
      }
    },
    "pagination": {
      "allOf": [
        {
          "$ref": "#/$defs/KnowledgeGraphPaginationSchema"
        }
      ]
    },
    "web_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "indexing_status": {
      "type": [
        "string",
        "null"
      ]
    },
    "connector": {
      "type": [
        "string",
        "null"
      ]
    },
    "context_block": {
      "type": [
        "string",
        "null"
      ],
      "description": "Type-specific metadata for the current node when it is a record — for a ticket, status, assignee, priority and dates."
    },
    "text": {
      "type": "string",
      "description": "Flat-text rendering of this view: breadcrumbs, the current node's\nmetadata, the children listing with an id per row, `Related:`, and\na closing `Next:` line naming a follow-up call.\n\nShape depends on the page: pages after the first omit the header,\nbreadcrumbs and related rows to stay compact, while the structured\nfields above remain complete. Capped at 25,000 bytes, with a\ntruncation marker appended when exceeded.\n"
    }
  },
  "$defs": {
    "KnowledgeGraphNodeRefSchema": {
      "type": "object",
      "additionalProperties": false,
      "description": "Minimal identity reference for a node in the knowledge graph.",
      "required": [
        "id",
        "name",
        "node_type",
        "sub_type",
        "is_record"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Node identifier. Pass it back as `nodeId` to open this node. When `is_record` is true it is also the Record ID accepted by GET /connectors/record/{recordId}/content."
        },
        "name": {
          "type": "string"
        },
        "node_type": {
          "type": "string",
          "description": "One of `app`, `recordGroup`, `folder`, `record`."
        },
        "sub_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. `TICKET`, `CONFLUENCE_PAGE`, `PROJECT`, `COLLECTION`."
        },
        "is_record": {
          "type": "boolean",
          "description": "True for record and folder nodes — the nodes whose content can be read via GET /connectors/record/{recordId}/content."
        }
      }
    },
    "KnowledgeGraphNodeRowSchema": {
      "type": "object",
      "additionalProperties": false,
      "description": "One row in a navigate listing. Carries the identity fields of\nKnowledgeGraphNodeRefSchema (inlined rather than composed, so this\nobject can stay closed) plus display detail.\n",
      "required": [
        "id",
        "name",
        "node_type",
        "sub_type",
        "is_record",
        "has_children",
        "detail"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "node_type": {
          "type": "string",
          "description": "One of `recordGroup`, `folder`, `record`. Listings never contain `app` nodes."
        },
        "sub_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_record": {
          "type": "boolean"
        },
        "has_children": {
          "type": "boolean",
          "description": "Whether this node can itself be opened with `nodeId`."
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. size, indexing status, or relationship type."
        },
        "web_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Link to the record in its source system. Records that carry a relative URL (uploaded/KB records) are resolved against the configured frontend public URL (see POST /configurationManager/frontendPublicUrl). The value is null when that host is not configured."
        },
        "indexing_status": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_created_at": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "description": "Creation time in the source system, epoch milliseconds. Null when the underlying node did not carry one."
        },
        "source_modified_at": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64"
        },
        "level": {
          "type": "integer",
          "description": "1-based nesting depth from the navigated parent. Always 1 for a `depth=1` listing; 2 or 3 for deeper rows when `depth` > 1."
        },
        "context_summary": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "KnowledgeGraphPaginationSchema": {
      "type": "object",
      "additionalProperties": false,
      "description": "Pagination envelope for a navigate listing.",
      "required": [
        "page",
        "limit",
        "total",
        "has_next",
        "has_prev"
      ],
      "properties": {
        "page": {
          "type": "integer"
        },
        "limit": {
          "type": "integer"
        },
        "total": {
          "type": "integer",
          "description": "Total children of the current node, ignoring pagination."
        },
        "has_next": {
          "type": "boolean"
        },
        "has_prev": {
          "type": "boolean"
        }
      }
    }
  }
}