---
title: "Get Asset Lineage"
method: GET
path: "/api/v1/sdk/lineage/{asset_id}"
tags: ["public-api", "public-lineage"]
---

# Get Asset Lineage

`GET /api/v1/sdk/lineage/{asset_id}`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/sdk/lineage/{asset_id}`
- Auth: none declared

Get lineage graph for an asset.

Returns upstream (dependencies) and downstream (dependents) assets.

**SDK Usage:**
```python
from anomalyarmor import Client
client = Client()

lineage = client.lineage.get("postgresql.mydb.public.users", depth=2)
for upstream in lineage.upstream:
    print(f"Depends on: {upstream.qualified_name}")
```

**CLI Usage:**
```bash
armor lineage get postgresql.mydb.public.users --depth 2
```

## Path parameters

- `asset_id` string, required

## Query parameters

- `depth` integer: How many levels of lineage to fetch
- `direction` string: Direction: upstream, downstream, or both

## Headers

- `Authorization` string

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
