Lineage API
Query and manage data lineage relationships.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /catalog/spaces/{slug}/products/{id}/lineage | Product lineage |
| PUT | /catalog/spaces/{slug}/products/{id}/lineage | Update lineage |
| GET | /lineage/graph | Global lineage graph |
Get Product Lineage
GET /catalog/spaces/{slug}/products/{id}/lineage
Query Parameters
| Parameter | Type | Description |
|---|---|---|
depth | integer | How many levels (default: 1) |
direction | string | upstream, downstream, both |
Response
{
"product": {
"id": "...",
"name": "Order Metrics"
},
"upstream": [
{
"id": "...",
"name": "Raw Orders",
"product_type": "table",
"depth": 1,
"relationship": "transforms"
},
{
"id": "...",
"name": "Customer Dim",
"product_type": "table",
"depth": 1,
"relationship": "joins"
}
],
"downstream": [
{
"id": "...",
"name": "Executive Dashboard",
"product_type": "dashboard",
"depth": 1,
"relationship": "consumes"
}
]
}
Update Lineage
PUT /catalog/spaces/{slug}/products/{id}/lineage
Request Body
{
"upstream_ids": ["product-uuid-1", "product-uuid-2"],
"downstream_ids": ["product-uuid-3"]
}
This replaces existing lineage relationships.
Add Single Upstream
POST /catalog/spaces/{slug}/products/{id}/lineage/upstream
{
"product_id": "upstream-product-uuid",
"relationship": "transforms"
}
Remove Upstream
DELETE /catalog/spaces/{slug}/products/{id}/lineage/upstream/{upstream_id}
Global Lineage Graph
Query lineage across the entire space.
GET /lineage/graph
Query Parameters
| Parameter | Type | Description |
|---|---|---|
space_id | uuid | Required |
selector | string | dbt-style selector |
root_id | uuid | Start from specific product |
Selector Syntax
Qarion supports dbt-style selectors:
| Selector | Meaning |
|---|---|
product_name | Single product |
product_name+ | Product and all downstream |
+product_name | All upstream and product |
+product_name+ | Full lineage chain |
product_name+2 | Product and 2 levels downstream |
Example
curl -X GET "https://api.qarion.com/lineage/graph?space_id=...&selector=order_metrics+3" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"nodes": [
{
"id": "...",
"name": "Order Metrics",
"product_type": "table",
"layer": 0
},
{
"id": "...",
"name": "Executive Dashboard",
"product_type": "dashboard",
"layer": 1
}
],
"edges": [
{
"source": "order-metrics-uuid",
"target": "dashboard-uuid",
"relationship": "consumes"
}
]
}
Lineage Impact Analysis
Analyze what would be affected by changes.
GET /lineage/impact
Query Parameters
| Parameter | Type | Description |
|---|---|---|
product_id | uuid | Product to analyze |
depth | integer | How deep to analyze |
Response
{
"affected_products": 5,
"affected_dashboards": 2,
"affected_contracts": 1,
"products": [
{
"id": "...",
"name": "...",
"owner": {"id": "...", "name": "..."}
}
],
"stakeholders": [
{"id": "...", "name": "...", "email": "..."}
]
}