> For the complete documentation index, see [llms.txt](https://docs.decube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decube.io/public-api/overview/index/lineage.md).

# Lineage

The Lineage API allows you to track and manage data lineage relationships between assets in your Decube organization. Use these endpoints to retrieve lineage graphs, create, and maintain manual lineage connections, supporting data governance and impact analysis across your data ecosystem.

## Get Lineage

Retrieve the full lineage graph for a given asset in a single direction — either upstream (sources that feed into it) or downstream (assets it feeds into). The response contains two lists: `nodes`, which are the unique assets in the graph including the queried asset itself, and `relationships`, which are the connections between them. Both top-level and column-level relationships are included.

Each relationship carries a `data` array describing the lineage sub-type — for example, whether the connection comes from a SQL transformation, a BI tool, an ETL job, or a manually created link. Use the `direction` parameter to walk the graph one direction at a time.

## Get Lineage

> Get the lineage graph for an asset in the specified direction

```json
{"openapi":"3.1.0","info":{"title":"Decube Public API (BETA)","version":"1.0.0"},"servers":[{"url":"https://connect.<REGION>.decube.io/api/v1/data"}],"paths":{"/catalog/lineage":{"get":{"tags":["Catalog","Lineage"],"summary":"Get Lineage","description":"Get the lineage graph for an asset in the specified direction","operationId":"get_lineage_catalog_lineage_get","parameters":[{"name":"asset_id","in":"query","required":true,"schema":{"type":"integer","description":"ID of the asset","title":"Asset Id"},"description":"ID of the asset"},{"name":"asset_type","in":"query","required":true,"schema":{"enum":["dataset","dashboard","chart"],"type":"string","description":"Type of the asset","title":"Asset Type"},"description":"Type of the asset"},{"name":"direction","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Direction","description":"Direction of lineage to traverse"},"description":"Direction of lineage to traverse"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLineages"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Direction":{"type":"string","enum":["upstream","downstream"],"title":"Direction"},"PublicLineages":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/PublicLineageNode"},"type":"array","title":"Nodes"},"relationships":{"items":{"$ref":"#/components/schemas/PublicLineageRelationship"},"type":"array","title":"Relationships"}},"type":"object","required":["nodes","relationships"],"title":"PublicLineages"},"PublicLineageNode":{"properties":{"id":{"type":"integer","title":"Id"},"type":{"type":"string","enum":["dataset","dashboard","chart"],"title":"Type"},"columns":{"anyOf":[{"items":{"$ref":"#/components/schemas/PropertyIdentifier"},"type":"array"},{"type":"null"}],"title":"Columns"}},"type":"object","required":["id","type","columns"],"title":"PublicLineageNode"},"PropertyIdentifier":{"properties":{"type":{"type":"string","const":"property","title":"Type"},"id":{"type":"integer","minimum":1,"title":"Id","description":"Unique identifier of the property asset"}},"type":"object","required":["type","id"],"title":"PropertyIdentifier"},"PublicLineageRelationship":{"properties":{"from_id":{"type":"integer","title":"From Id"},"from_type":{"type":"string","enum":["dataset","dashboard","chart","property","data_job"],"title":"From Type"},"to_id":{"type":"integer","title":"To Id"},"to_type":{"type":"string","enum":["dataset","dashboard","chart","property","data_job"],"title":"To Type"},"from_parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"From Parent Id"},"from_parent_type":{"anyOf":[{"type":"string","enum":["dataset","dashboard","chart"]},{"type":"null"}],"title":"From Parent Type"},"to_parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"To Parent Id"},"to_parent_type":{"anyOf":[{"type":"string","enum":["dataset","dashboard","chart"]},{"type":"null"}],"title":"To Parent Type"},"data":{"items":{"oneOf":[{"$ref":"#/components/schemas/SimpleRelationshipData"},{"$ref":"#/components/schemas/EtlLineageRelationshipData"},{"$ref":"#/components/schemas/SqlLineageRelationshipData"},{"$ref":"#/components/schemas/ViewLineageRelationshipData"},{"$ref":"#/components/schemas/ManualRelationshipData"}],"discriminator":{"propertyName":"type","mapping":{"bi_lineage":"#/components/schemas/SimpleRelationshipData","etl_lineage":"#/components/schemas/EtlLineageRelationshipData","etl_sink":"#/components/schemas/SimpleRelationshipData","external_lineage":"#/components/schemas/SimpleRelationshipData","foreign_key":"#/components/schemas/SimpleRelationshipData","manual":"#/components/schemas/ManualRelationshipData","sql_lineage":"#/components/schemas/SqlLineageRelationshipData","view_lineage":"#/components/schemas/ViewLineageRelationshipData"}}},"type":"array","title":"Data"}},"type":"object","required":["from_id","from_type","to_id","to_type","from_parent_id","from_parent_type","to_parent_id","to_parent_type","data"],"title":"PublicLineageRelationship"},"SimpleRelationshipData":{"properties":{"type":{"type":"string","enum":["foreign_key","bi_lineage","external_lineage","etl_sink"],"title":"Type"}},"type":"object","required":["type"],"title":"SimpleRelationshipData"},"EtlLineageRelationshipData":{"properties":{"type":{"type":"string","const":"etl_lineage","title":"Type"},"data_job":{"$ref":"#/components/schemas/DataJobIdentifier"}},"type":"object","required":["type","data_job"],"title":"EtlLineageRelationshipData"},"DataJobIdentifier":{"properties":{"type":{"type":"string","const":"data_job","title":"Type"},"id":{"type":"integer","minimum":1,"title":"Id","description":"Unique identifier of the data job asset"}},"type":"object","required":["type","id"],"title":"DataJobIdentifier"},"SqlLineageRelationshipData":{"properties":{"type":{"type":"string","const":"sql_lineage","title":"Type"},"query":{"type":"string","title":"Query"}},"type":"object","required":["type","query"],"title":"SqlLineageRelationshipData"},"ViewLineageRelationshipData":{"properties":{"type":{"type":"string","const":"view_lineage","title":"Type"},"view_definition":{"type":"string","title":"View Definition"}},"type":"object","required":["type","view_definition"],"title":"ViewLineageRelationshipData"},"ManualRelationshipData":{"properties":{"type":{"type":"string","const":"manual","title":"Type"},"data_job":{"anyOf":[{"$ref":"#/components/schemas/DataJobIdentifier"},{"type":"null"}]},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["type","data_job","created_by","created_at"],"title":"ManualRelationshipData"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Manual Lineage

## List Manual Lineages On Object

> List any manual lineages attached to an object in the specified direction

```json
{"openapi":"3.1.0","info":{"title":"Decube Public API (BETA)","version":"1.0.0"},"servers":[{"url":"https://connect.<REGION>.decube.io/api/v1/data"}],"paths":{"/catalog/lineage/manual_lineage":{"get":{"tags":["Catalog","Lineage"],"summary":"List Manual Lineages On Object","description":"List any manual lineages attached to an object in the specified direction","operationId":"list_manual_lineages_on_object_catalog_lineage_manual_lineage_get","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","description":"The ID of the object to list lineages for","title":"Id"},"description":"The ID of the object to list lineages for"},{"name":"type","in":"query","required":true,"schema":{"enum":["dataset","dashboard","chart"],"type":"string","description":"The type of the object to list lineages for","title":"Type"},"description":"The type of the object to list lineages for"},{"name":"object_is","in":"query","required":true,"schema":{"enum":["source","target"],"type":"string","description":"Whether the object is the source or target of the lineage","title":"Object Is"},"description":"Whether the object is the source or target of the lineage"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LineageData"},"title":"Response List Manual Lineages On Object Catalog Lineage Manual Lineage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"LineageData":{"properties":{"id":{"type":"integer","title":"Id"},"source":{"$ref":"#/components/schemas/DataAssets"},"target":{"$ref":"#/components/schemas/DataAssets"},"data_job":{"anyOf":[{"$ref":"#/components/schemas/DataAssets"},{"type":"null"}]}},"type":"object","required":["id","source","target"],"title":"LineageData"},"DataAssets":{"properties":{"type":{"type":"string","title":"Type"},"name":{"type":"string","title":"Name"},"id":{"type":"integer","title":"Id"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/DbType"},{"$ref":"#/components/schemas/AssetMetadataSubtypes"},{"type":"string","enum":["glossary","category","term"]}],"title":"Subtype"},"qual_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qual Id"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"}},"type":"object","required":["type","name","id","subtype"],"title":"DataAssets"},"DbType":{"type":"string","enum":["bigquery","redshift","postgresql","mysql","snowflake","databricks","sql_server","azure_server","singlestore","synapse","oracle","cloudera_hive","hive","power_bi","tableau","looker","dbt_cloud","dbt_core","fivetran","airflow","adf","glue","s3dl","adls","gcsdl","open_lineage","spark","iceberg","cloudera_atlas","atlas","unknown","virtual_source"],"title":"DbType"},"AssetMetadataSubtypes":{"type":"string","enum":["database","schema","table","virtual_table","view","column","virtual_column","data_job","data_task","data_job_run","data_task_run","file","glossary","category","term","monitor","incident","case","policy","policy_rule","property_monitor","dataset_monitor","etl_monitor","custom_monitor","dashboard","report","chart"],"title":"AssetMetadataSubtypes"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Create Manual Lineage

> Create a manual lineage between two objects, returns the ID of the generated lineage

```json
{"openapi":"3.1.0","info":{"title":"Decube Public API (BETA)","version":"1.0.0"},"servers":[{"url":"https://connect.<REGION>.decube.io/api/v1/data"}],"paths":{"/catalog/lineage/manual_lineage":{"post":{"tags":["Catalog","Lineage"],"summary":"Create Manual Lineage","description":"Create a manual lineage between two objects, returns the ID of the generated lineage","operationId":"create_manual_lineage_catalog_lineage_manual_lineage_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManualLineageBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Create Manual Lineage Catalog Lineage Manual Lineage Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CreateManualLineageBody":{"properties":{"source":{"$ref":"#/components/schemas/AssetIdentifier-Input"},"target":{"$ref":"#/components/schemas/AssetIdentifier-Input"},"data_job":{"anyOf":[{"$ref":"#/components/schemas/DataJobIdentifier"},{"type":"null"}]}},"type":"object","required":["source","target"],"title":"CreateManualLineageBody"},"AssetIdentifier-Input":{"properties":{"id":{"type":"integer","title":"Id"},"type":{"type":"string","enum":["dataset","property","chart","dashboard"],"title":"Type"}},"type":"object","required":["id","type"],"title":"AssetIdentifier"},"DataJobIdentifier":{"properties":{"type":{"type":"string","const":"data_job","title":"Type"},"id":{"type":"integer","minimum":1,"title":"Id","description":"Unique identifier of the data job asset"}},"type":"object","required":["type","id"],"title":"DataJobIdentifier"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Delete Manual Lineage

> Delete a manual lineage between two objects

```json
{"openapi":"3.1.0","info":{"title":"Decube Public API (BETA)","version":"1.0.0"},"servers":[{"url":"https://connect.<REGION>.decube.io/api/v1/data"}],"paths":{"/catalog/lineage/manual_lineage":{"delete":{"tags":["Catalog","Lineage"],"summary":"Delete Manual Lineage","description":"Delete a manual lineage between two objects","operationId":"delete_manual_lineage_catalog_lineage_manual_lineage_delete","parameters":[{"name":"source_id","in":"query","required":true,"schema":{"type":"integer","description":"The ID of the source object","title":"Source Id"},"description":"The ID of the source object"},{"name":"source_type","in":"query","required":true,"schema":{"enum":["dataset","dashboard","chart"],"type":"string","description":"The type of the source object","title":"Source Type"},"description":"The type of the source object"},{"name":"target_id","in":"query","required":true,"schema":{"type":"integer","description":"The ID of the target object","title":"Target Id"},"description":"The ID of the target object"},{"name":"target_type","in":"query","required":true,"schema":{"enum":["dataset","dashboard","chart"],"type":"string","description":"The type of the target object","title":"Target Type"},"description":"The type of the target object"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decube.io/public-api/overview/index/lineage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
