> For the complete documentation index, see [llms.txt](https://docs.truedat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truedat.io/v8.8/api-integrations/data-catalog-data-lineage-and-grants-apis/data-lineage.md).

# Data Lineage

## List lineage events

> Retrieves all lineage events for the current user

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/lineage_events":{"get":{"description":"Retrieves all lineage events for the current user","operationId":"TdDdWeb.LineageEventController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineageEventsIndexResponse"}}},"description":"Lineage events retrieved"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List lineage events","tags":["Data Lineage"]}}},"components":{"schemas":{"LineageEventsIndexResponse":{"description":"List of lineage events for the current user","items":{"$ref":"#/components/schemas/LineageEventResponse"},"title":"LineageEventsIndexResponse","type":"array"},"LineageEventResponse":{"additionalProperties":false,"properties":{"graph_data":{"description":"Serialized graph data","nullable":true,"type":"string"},"graph_hash":{"description":"Unique hash of the graph","type":"string"},"graph_id":{"description":"Associated graph ID","nullable":true,"type":"integer"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"message":{"description":"Additional message","nullable":true,"type":"string"},"status":{"description":"Current status of the lineage event","enum":["COMPLETED","ALREADY_STARTED","FAILED","TIMED_OUT"],"type":"string"},"task_reference":{"description":"Reference to the background task","nullable":true,"type":"string"},"type":{"description":"Type of lineage event","nullable":true,"type":"string"},"user_id":{"description":"User who created the event","type":"integer"}},"required":["user_id","graph_hash","status","inserted_at"],"title":"LineageEventResponse","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Export graph as CSV

> Exports a graph's data as a ZIP archive containing CSV files.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/graphs/csv":{"post":{"description":"Exports a graph's data as a ZIP archive containing CSV files.","operationId":"TdDdWeb.GraphController.csv","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphCSVRequest"}}},"description":"Graph CSV export payload","required":false},"responses":{"200":{"content":{"text/csv":{"schema":{"format":"binary","type":"string"}}},"description":"CSV file downloaded"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdNotFoundErrorResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Export graph as CSV","tags":["Data Lineage"]}}},"components":{"schemas":{"GraphCSVRequest":{"additionalProperties":false,"properties":{"id":{"anyOf":[{"type":"string"},{"type":"integer"}],"description":"Graph ID to export as CSV (string or integer)"}},"required":["id"],"title":"GraphCSVRequest","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdNotFoundErrorResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdNotFoundErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Create graph

> Creates a new graph for lineage or impact analysis.\
> \- \`type: "sample"\` → no requiere \`ids\`\
> \- \`type: "lineage"\` o \`"impact"\` → requiere \`ids\`<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/graphs":{"post":{"description":"Creates a new graph for lineage or impact analysis.\n- `type: \"sample\"` → no requiere `ids`\n- `type: \"lineage\"` o `\"impact\"` → requiere `ids`\n","operationId":"TdDdWeb.GraphController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphCreateRequest"}}},"description":"Graph create payload","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphResponse"}}},"description":"Graph created"},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphResponse"}}},"description":"Graph processing"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnprocessableEntityObjectResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create graph","tags":["Data Lineage"]}}},"components":{"schemas":{"GraphCreateRequest":{"additionalProperties":false,"properties":{"excludes":{"description":"Resources to exclude from the graph","items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"nullable":true,"type":"array"},"header_labels":{"description":"Include header labels in the response","nullable":true,"type":"boolean"},"ids":{"description":"List of resource identifiers (strings or integers)","items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},"levels":{"description":"Number of levels to traverse","nullable":true,"type":"integer"},"type":{"description":"Type of graph to generate","enum":["lineage","impact","sample"],"type":"string"}},"required":["type","ids"],"title":"GraphCreateRequest","type":"object"},"GraphResponse":{"anyOf":[{"$ref":"#/components/schemas/GraphCompletedResponse"},{"$ref":"#/components/schemas/GraphProcessingResponse"}],"description":"Response for graph creation. Can be completed (201) or processing (202)","title":"GraphResponse"},"GraphCompletedResponse":{"additionalProperties":false,"properties":{"excludes":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"nullable":true,"type":"array"},"groups":{"items":{"type":"object"},"type":"array"},"header_labels":{"nullable":true,"type":"boolean"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"ids":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},"levels":{"nullable":true,"type":"integer"},"opts":{"additionalProperties":true,"type":"object"},"paths":{"items":{"type":"object"},"type":"array"},"resources":{"items":{"type":"object"},"type":"array"}},"required":["id","ids","opts"],"title":"GraphCompletedResponse","type":"object"},"GraphProcessingResponse":{"additionalProperties":false,"properties":{"graph_hash":{"description":"Unique hash identifying the graph","type":"string"},"status":{"description":"Status of the graph processing","enum":["JUST_STARTED","ALREADY_STARTED"],"type":"string"},"task_reference":{"description":"Task reference for tracking progress","nullable":true,"type":"string"}},"required":["graph_hash","status"],"title":"GraphProcessingResponse","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdUnprocessableEntityObjectResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnprocessableEntityObjectResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Get graph

> Retrieves a graph by its ID, automatically recalculating it if it is stale.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/graphs/{id}":{"get":{"description":"Retrieves a graph by its ID, automatically recalculating it if it is stale.","operationId":"TdDdWeb.GraphController.show","parameters":[{"description":"Graph ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphShowResponse"}}},"description":"Graph retrieved"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdNotFoundErrorResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get graph","tags":["Data Lineage"]}}},"components":{"schemas":{"GraphShowResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/GraphCompletedResponse"}},"required":["data"],"title":"GraphShowResponse","type":"object"},"GraphCompletedResponse":{"additionalProperties":false,"properties":{"excludes":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"nullable":true,"type":"array"},"groups":{"items":{"type":"object"},"type":"array"},"header_labels":{"nullable":true,"type":"boolean"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"ids":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},"levels":{"nullable":true,"type":"integer"},"opts":{"additionalProperties":true,"type":"object"},"paths":{"items":{"type":"object"},"type":"array"},"resources":{"items":{"type":"object"},"type":"array"}},"required":["id","ids","opts"],"title":"GraphCompletedResponse","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdNotFoundErrorResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdNotFoundErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Get graph by hash

> Retrieves a graph by its hash value, returning its current data or processing status.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/graphs/hash/{hash}":{"get":{"description":"Retrieves a graph by its hash value, returning its current data or processing status.","operationId":"TdDdWeb.GraphController.get_graph_by_hash","parameters":[{"description":"Graph hash","in":"path","name":"hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphHashResponse"}}},"description":"Graph retrieved"},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphHashResponse"}}},"description":"Graph processing"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdNotFoundErrorResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get graph by hash","tags":["Data Lineage"]}}},"components":{"schemas":{"GraphHashResponse":{"anyOf":[{"$ref":"#/components/schemas/GraphHashCompletedResponse"},{"$ref":"#/components/schemas/GraphHashProcessingResponse"}],"description":"Response for graph retrieval by hash. Can be completed (200) or processing (202)","title":"GraphHashResponse"},"GraphHashCompletedResponse":{"additionalProperties":false,"properties":{"excludes":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"nullable":true,"type":"array"},"groups":{"items":{"type":"object"},"type":"array"},"hash":{"type":"string"},"header_labels":{"nullable":true,"type":"boolean"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"ids":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},"levels":{"nullable":true,"type":"integer"},"opts":{"additionalProperties":true,"type":"object"},"paths":{"items":{"type":"object"},"type":"array"},"resources":{"items":{"type":"object"},"type":"array"}},"required":["id","hash","ids","opts"],"title":"GraphHashCompletedResponse","type":"object"},"GraphHashProcessingResponse":{"additionalProperties":false,"properties":{"graph_data":{"nullable":true,"type":"string"},"graph_hash":{"type":"string"},"graph_id":{"nullable":true,"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"message":{"nullable":true,"type":"string"},"status":{"enum":["ALREADY_STARTED"],"type":"string"},"task_reference":{"nullable":true,"type":"string"},"user_id":{"type":"integer"}},"required":["graph_hash","status","inserted_at","user_id"],"title":"GraphHashProcessingResponse","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdNotFoundErrorResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdNotFoundErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```
