# Lineage

Lineage covers both data-object lineage (datasets and views, transformers, transformer runs, data-quality tests, consumers, data inputs, entity groups, and the relationships between them — see [Data Objects Lineage](/features/data-lineage/data-objects.md)) and microservices lineage ([Microservices Lineage](/features/data-lineage/microservices.md)). Both surfaces are backed by the same three endpoints below — entity-class participation is determined by what the data sources have ingested, not by a separate API. For the canonical class reference, see the [ODD Data Model](https://github.com/opendatadiscovery/opendatadiscovery-specification/blob/main/specification/specification.md#data-model-specification).

**Per-entity lineage**

| Method | Path                                                    | Operation ID                     | Purpose                                                                                          |
| ------ | ------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------ |
| `GET`  | `/api/dataentities/{data_entity_id}/lineage/upstream`   | `getDataEntityUpstreamLineage`   | Returns the upstream lineage graph rooted at the given data entity (everything that feeds it).   |
| `GET`  | `/api/dataentities/{data_entity_id}/lineage/downstream` | `getDataEntityDownstreamLineage` | Returns the downstream lineage graph rooted at the given data entity (everything it feeds into). |

Both endpoints accept the same two optional query parameters that control the shape of the returned graph:

| Parameter             | Type                              | Behaviour                                                                                                                                                                                                                                     |
| --------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lineage_depth`       | `integer` *(minimum `1`)*         | Number of hops to traverse from the rooted entity. Unset returns the platform's default depth. Lower values give a quick neighbourhood view; higher values follow cross-system pipelines end-to-end at the cost of a larger response payload. |
| `expanded_entity_ids` | `array of integer` *(repeatable)* | IDs of `Data Entity Group` entities that should be expanded inline in the response. By default groups appear as a single collapsed node; passing a group's ID here drills into that one group for the request without expanding any others.   |

**Group lineage**

| Method | Path                                                   | Operation ID                 | Purpose                                                                                                                                                                                                                                                                 |
| ------ | ------------------------------------------------------ | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET`  | `/api/dataentitygroups/{data_entity_group_id}/lineage` | `getDataEntityGroupsLineage` | Returns the lineage graph **for the group's children** — i.e. the lineage relationships among the entities that belong to the given group. Use it to inspect what a group aggregates without first expanding each member entity through the per-entity endpoints above. |

## See also

* [API Reference hub](/developer-guides/api-reference.md) — the full per-feature index.
* [Data Objects Lineage](/features/data-lineage/data-objects.md) — data-object lineage feature description.
* [Microservices Lineage](/features/data-lineage/microservices.md) — microservices lineage feature description.


---

# Agent Instructions: 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:

```
GET https://docs.opendatadiscovery.org/developer-guides/api-reference/lineage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
