---
title: "List lineage for a data model"
method: GET
path: "/v2/dataModels/{dataModelId}/lineage"
tags: ["Data models"]
---

# List lineage for a data model

`GET /v2/dataModels/{dataModelId}/lineage`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/dataModels/{dataModelId}/lineage`
- Auth: HTTP bearer

This endpoint lists the elements, data sources, and upstream lineage for those data sources in a data model, providing a detailed view of how data is interconnected within a data model.

  ### Usage notes
  - Retrieve the **dataModelId** by calling the [/v2/dataModels](https://help.sigmacomputing.com/reference/list-data-models) endpoint.

  ### Usage scenarios
  - **Data governance:** Allows data managers to track how information is used and propagated through different data model elements.
  - **Debugging and optimization:** Helps with identifying and resolving issues in data processing or data model structure.
  - **Data source management**: Identify the dependencies of data sources in use in a specific data model.

  ### Best practices
  - Integrate this information into documentation or data dictionaries to enhance transparency and understanding across teams.
  - Use this endpoint to regularly audit data model structures, ensuring that all data connections and transformations are correct and optimized.

## Path parameters

- `dataModelId` string, required

## Query parameters

- `page` string
- `limit` number, double

## Response `200`

The response body.

- DataModelsListDataModelLineageTreeResponse200
  - `entries` V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems[], required
    - union
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems0
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `sourceIds` string[], nullable, required: List of direct sources for the element. Either element IDs or data source IDs.
        - `elementId` string, required: Unique identifier of the element
        - `dataSourceIds` string[], nullable, required: List of root sources for the element as data source IDs.
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems1
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `dataModelId` string, required
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems2
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `inodeId` string, required
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems3
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `definition` string, required
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems4
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `csvId` string, required: Unique identifier of the uploaded CSV file
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems5
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `semanticViewId` string, required: Unique identifier of the semantic view
        - `semanticViewTable` string, required: Name of the table within the semantic view
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems6
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `sqlDocumentId` string, required
      - V2DataModelsDataModelIdLineageGetResponsesContentApplicationJsonSchemaEntriesItems7
        - `type` 'table' | 'dataset' | 'data-model' | 'element' | 'customSQL' | 'csv-upload' | 'semantic-view' | 'sql-document' | 'worksheet', required
        - `connectionId` string, nullable, required
        - `name` string, nullable, required
        - `worksheetId` string, required: Unique identifier of the worksheet
  - `nextPage` string, nullable, required
  - `total` number, double

---

[API](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api.md) - [All operations](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/revisions/fb6036208c49?raw)
