---
updatedAt: 2026-09-08T20:26:09.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# Get the lineage graph neighborhood around a focal dataset

Returns the BFS-nearest lineage neighborhood around the focal
dataset id, walking transform data-input edges (`InputRole=Data`)
in both directions over the default-filtered dataset set
(excludes monitors and metric SMA datasets). The response uses
the same `Dataset-GraphResponse` shape as `GET /v1/datasets/graph`.

Lineage view semantics: foreign-key edges are **not** traversed by
this endpoint — they are surfaced by the full-graph endpoint for
the Link/Explore-Universe views. Reference-role transform inputs
are also excluded.

Ordering within the response is BFS order: focal dataset first,
then by BFS depth. Order within a depth is unspecified but
stable for a given graph. If the walk exceeds `limit`, the
response is truncated to the nearest `limit` datasets and
`meta.totalCount` is set to `-1`. CEL `filter` and `expand` are
not supported.

`foreignKeyTargetIds`, `inputDatasetIds`, and
`restrictedConnections` reference only datasets in the response.

When view-permission filtering is enabled, a focal dataset the
caller cannot view returns 404, and the walk can also cross
restricted lineage connections.


# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Observe by Snowflake API",
    "description": "# Overview\nWelcome to the Observe API Docs!\n\nThe Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded.\n\n## Authentication\nRequests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication:\n```\n// passing token as bearer token\ncurl -H \"Authorization: Bearer <customerid> <token>\" https://<customerid>.<observe-domain>.com/v1/...\n```\n",
    "version": "1.0.230307"
  },
  "servers": [
    {
      "url": "https://{customerid}.observeinc.com",
      "description": "US west server",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        }
      }
    },
    {
      "url": "https://{customerid}.{cluster}.observeinc.com",
      "description": "Specific regional cluster (prod)",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        },
        "cluster": {
          "enum": [
            "eu-1",
            "ap-1"
          ],
          "default": "eu-1",
          "description": "For regional clusters, choose one."
        }
      }
    },
    {
      "url": "https://{customerid}.{domain}.com",
      "description": "Specific Observe server",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        },
        "domain": {
          "default": "OBSERVE_DOMAIN",
          "description": "The Observe domain for your instance."
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Dataset",
      "description": "Manage datasets. Learn more about [datasets](https://docs.observeinc.com/en/latest/content/reference/ObserveKeyConcepts.html#datasets)..\n"
    }
  ],
  "paths": {
    "/v1/datasets/{id}/graph": {
      "get": {
        "summary": "Get the lineage graph neighborhood around a focal dataset",
        "description": "Returns the BFS-nearest lineage neighborhood around the focal\ndataset id, walking transform data-input edges (`InputRole=Data`)\nin both directions over the default-filtered dataset set\n(excludes monitors and metric SMA datasets). The response uses\nthe same `Dataset-GraphResponse` shape as `GET /v1/datasets/graph`.\n\nLineage view semantics: foreign-key edges are **not** traversed by\nthis endpoint — they are surfaced by the full-graph endpoint for\nthe Link/Explore-Universe views. Reference-role transform inputs\nare also excluded.\n\nOrdering within the response is BFS order: focal dataset first,\nthen by BFS depth. Order within a depth is unspecified but\nstable for a given graph. If the walk exceeds `limit`, the\nresponse is truncated to the nearest `limit` datasets and\n`meta.totalCount` is set to `-1`. CEL `filter` and `expand` are\nnot supported.\n\n`foreignKeyTargetIds`, `inputDatasetIds`, and\n`restrictedConnections` reference only datasets in the response.\n\nWhen view-permission filtering is enabled, a focal dataset the\ncaller cannot view returns 404, and the walk can also cross\nrestricted lineage connections.\n",
        "operationId": "GetDatasetGraph",
        "tags": [
          "Dataset"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "int64"
            },
            "required": true,
            "description": "Focal dataset id.",
            "example": "41000234"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 5000,
              "default": 500
            },
            "required": false,
            "description": "Max number of datasets (including the focal) in the returned neighborhood.\nRestricted connections do not count toward this cap.\nDefault 500, max 5000. When the BFS hits this cap, meta.totalCount is -1.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Lineage neighborhood retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset-GraphResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse-400"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse-401"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse-403"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse-404"
          },
          "429": {
            "$ref": "#/components/responses/ErrorResponse-429"
          },
          "5XX": {
            "$ref": "#/components/responses/ErrorResponse-5XX"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Authorization: Bearer <customerid> <apitoken>\n"
      }
    },
    "schemas": {
      "ObjectId": {
        "type": "string",
        "format": "ObjectId"
      },
      "Meta": {
        "description": "List Response Metadata",
        "type": "object",
        "required": [
          "totalCount"
        ],
        "properties": {
          "totalCount": {
            "description": "The total number of resources available, independent of pagination.\nThe API may return -1 if the total count is unknown or cannot be computed\nin reasonable time.\n",
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ErrorMessage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "A stable, machine-readable identifier for the kind of error."
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        },
        "required": [
          "type",
          "message"
        ]
      },
      "DatasetContentType": {
        "title": "DatasetContentType",
        "type": "string",
        "description": "The type of data a dataset contains. For Resource datasets, this is\ndetermined by the dataset kind. For other kinds, it is derived from the\ndataset's interface bindings. Returns Unknown if no recognized interface\nis found.\n",
        "enum": [
          "Unknown",
          "Resource",
          "Log",
          "Metric",
          "OTelSpan",
          "OTelTrace"
        ]
      },
      "DatasetBrief": {
        "title": "DatasetBrief",
        "type": "object",
        "description": "Brief record fields for a DatasetRef (label, description, iconUrl, contentType). Field naming mirrors ObjectBrief in this same file (iconUrl, not icon) for consistency across reference-brief pairs.\n",
        "required": [
          "label",
          "description",
          "iconUrl",
          "contentType"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "iconUrl": {
            "type": "string"
          },
          "contentType": {
            "$ref": "#/components/schemas/DatasetContentType",
            "description": "The type of data the referenced dataset contains — Resource, Log,\nMetric, OTelSpan, OTelTrace, or Unknown. Derived from the dataset's\nkind and interface bindings.\n"
          }
        }
      },
      "DatasetRef": {
        "title": "DatasetRef",
        "type": "object",
        "description": "A reference to a dataset. Always carries the id; the optional `record` field carries the brief metadata, populated when expand=true. Mirrors ObjectRef (see ObjectRef / ObjectBrief in this file).\n",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ObjectId"
          },
          "record": {
            "$ref": "#/components/schemas/DatasetBrief"
          }
        }
      },
      "Dataset-DatasetKind": {
        "title": "DatasetKind",
        "type": "string",
        "enum": [
          "Table",
          "Resource",
          "Event",
          "Interval"
        ]
      },
      "Dataset-CompilationError": {
        "title": "CompilationError",
        "type": "object",
        "required": [
          "error",
          "errorInDataset"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "errorInDataset": {
            "description": "Reference to the upstream dataset that produced the compilation\nerror. Weak ref: in many cases the upstream dataset cannot be\nresolved (cross-workspace deletion, RBAC visibility, race with\nsoft-delete). When unresolvable, the field is null and the caller\nstill has the `error` string. The field is always present; only\nits value is nullable.\n",
            "anyOf": [
              {
                "$ref": "#/components/schemas/DatasetRef"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Dataset-AccelerationState": {
        "title": "AccelerationState",
        "type": "string",
        "description": "The state of the dataset's acceleration.\nInitializing: The dataset is newly created/updated and acceleration has just started.\nAccelerated: The dataset is accelerated and available for querying.\nAcceleratedImmediately: The dataset is accelerated and available for querying. The dataset is also in \"live mode\", meaning it is being updated as fast as possible.\nUnavailable: The dataset is not accelerated and is not available for querying due to a compilation error in the dataset or upstream.\nDisabled: The dataset is not accelerated and is available for querying due to user disablement. (e.g. dataset is a view)\nError: The dataset is not accelerated and may return outdated results due to a critical error.\n",
        "enum": [
          "Initializing",
          "Accelerated",
          "AcceleratedImmediately",
          "Unavailable",
          "Disabled",
          "Error"
        ]
      },
      "Dataset-GraphSummary": {
        "title": "DatasetGraphSummary",
        "type": "object",
        "description": "Lean per-dataset projection used to render the Dataset Graph, Lineage tab,\nand Explore Universe views. Intentionally a strict subset of Dataset-Resource:\nonly the fields required to render a graph node and its outgoing edges.\nexpand is not supported on graph endpoints.\n\nNOTE: foreignKeyTargetIds and inputDatasetIds are returned as flat arrays of\nid strings rather than the nested reference shape used elsewhere in this API.\nThis is a deliberate divergence from the REST Style Guide accepted for payload\nsize on the full-graph endpoint; these fields are not expandable.\n",
        "required": [
          "id",
          "label",
          "kind",
          "contentType",
          "icon",
          "compilationError",
          "accelerationState",
          "foreignKeyTargetIds",
          "inputDatasetIds"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ObjectId",
            "readOnly": true
          },
          "label": {
            "type": "string",
            "description": "Full dataset label (path/name)."
          },
          "kind": {
            "$ref": "#/components/schemas/Dataset-DatasetKind"
          },
          "contentType": {
            "$ref": "#/components/schemas/DatasetContentType",
            "description": "The content type (Resource, Log, Metric, OTelSpan, OTelTrace, Unknown).\nCombined with kind to pick the dataset icon in the UI.\n"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explicit icon URL when set; null means the UI should derive from kind + contentType."
          },
          "compilationError": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Dataset-CompilationError"
              },
              {
                "type": "null"
              }
            ],
            "description": "Non-null when the dataset currently fails to compile. With view-permission\nfiltering, an error that originates in a dataset the caller cannot view has\na null `errorInDataset` and a generic `error`.\n"
          },
          "accelerationState": {
            "$ref": "#/components/schemas/Dataset-AccelerationState",
            "description": "The dataset's current acceleration state, projected out of AccelerationInfo.\nExposed as a top-level scalar on this endpoint to avoid batch-loading the\nfull AccelerationInfo object.\n"
          },
          "foreignKeyTargetIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectId"
            },
            "description": "Deduplicated list of foreign-key target dataset ids (forward edges only).\nSelf-references, targets pointing at datasets excluded by the default filter,\nand targets the caller cannot view are omitted.\n"
          },
          "inputDatasetIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectId"
            },
            "description": "Deduplicated list of dataset ids that feed this dataset via transform inputs\nwith InputRole=Data. Reference-role inputs and inputs the caller cannot view\nare excluded.\n"
          }
        }
      },
      "Dataset-GraphRelation": {
        "title": "DatasetGraphRelation",
        "type": "string",
        "description": "Which edges a restricted connection follows: `Lineage` for transform data\ninputs (`inputDatasetIds`), `Link` for foreign keys (`foreignKeyTargetIds`).\n",
        "enum": [
          "Lineage",
          "Link"
        ]
      },
      "Dataset-GraphRestrictedConnection": {
        "title": "DatasetGraphRestrictedConnection",
        "type": "object",
        "description": "Anonymous stand-in for one or more datasets the caller cannot view. Each source\nhas a path through them to each target.\n",
        "required": [
          "key",
          "relation",
          "sourceDatasetIds",
          "targetDatasetIds"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Opaque key, unique within the response. Not stable across responses.",
            "example": "rc:1"
          },
          "relation": {
            "$ref": "#/components/schemas/Dataset-GraphRelation"
          },
          "sourceDatasetIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectId"
            },
            "description": "Datasets that feed the restricted datasets (`Lineage`) or hold a foreign key\ninto them (`Link`).\n"
          },
          "targetDatasetIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectId"
            },
            "description": "Datasets the restricted datasets feed (`Lineage`) or hold a foreign key into\n(`Link`).\n"
          }
        }
      },
      "Dataset-GraphResponse": {
        "title": "DatasetGraphResponse",
        "type": "object",
        "description": "Response body for both GET /v1/datasets/graph and GET /v1/datasets/{id}/graph.\nOn the full-graph endpoint: datasets are sorted by id ascending, and meta.totalCount\nis always the number of returned datasets (never -1).\nOn the focal endpoint: datasets are sorted in BFS-nearest order (focal first, then\nby BFS depth; order within a depth is unspecified but stable for a given graph),\nand meta.totalCount is -1 iff the BFS was capped by limit; otherwise it is the\nnumber of returned datasets.\n",
        "required": [
          "datasets",
          "meta"
        ],
        "properties": {
          "datasets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Dataset-GraphSummary"
            }
          },
          "restrictedConnections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Dataset-GraphRestrictedConnection"
            },
            "description": "Paths through datasets the caller cannot view. Empty unless view-permission\nfiltering is enabled.\n"
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      }
    },
    "responses": {
      "ErrorResponse-400": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-401": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-403": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-404": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-429": {
        "description": "Rate limit reached",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-5XX": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      }
    }
  }
}
````