Assets

Get asset lineage

Changed on

Get the derivation lineage of an asset by asset ID: the inputs it was generated from, the generation requests along the way, and any referenced smart entities, traversed recursively up to depth levels. Deleted or expired ancestors stay in the graph flagged as tombstones; inputs that were never captured appear as external inputs.

Required permissions: assets:read. Key presets that include them: API, SERVERLESS, READONLY, FULL. See key permissions.

get/assets/{asset_id}/lineage

Request

  • Base URL
    https://api.fal.ai/v1
  • URL
    https://api.fal.ai/v1/assets/{asset_id}/lineage
  • Auth
    API key in header Authorization

Path parameters

asset_idstring required

Asset ID

Example:d8b6elcregj72v34jr8g

Query parameters

depthinteger

Maximum traversal depth (levels of derivation edges)

Example:5

Response

Asset lineage graph

Example response

{
  "lineage": {
    "focus": "asset:0f343b0931126a20f133d67c2b018a3b",
    "nodes": [
      {
        "id": "asset:0f343b0931126a20f133d67c2b018a3b",
        "output_key": "0f343b0931126a20f133d67c2b018a3b",
        "url": "https://v3b.fal.media/files/b/0a9b4900/portrait.png",
        "request_id": "019e6d0a-e5be-7b82-b329-35ae64296902",
        "asset_id": "d8b6elcregj72v34jr8g"
      }
    ],
    "edges": [
      {
        "from": "external:9e107d9d372bb6826bd81d3542a419d6",
        "to": "request:019e6d0a-e5be-7b82-b329-35ae64296902",
        "entities": [
          {
            "entity_id": "43ce3411-1a25-4d14-875e-3562d341b090",
            "entity_type": "character",
            "name": "Alice",
            "handle": "alice"
          }
        ]
      }
    ]
  }
}

Changes

    • info

      the endpoint scheme security readonlyApiKey was added to the API

    • info

      the endpoint scheme security apiKey was removed from the API