# Create External Lineage Relationship

Launch stage: Public Preview

`POST /api/2.0/lineage-tracking/external-lineage`

Creates an external lineage relationship between a <Databricks> or external metadata object and another external metadata object.

API scopes: unity-catalog

## Request body

- `external_lineage_relationship` (object, optional)
  - `id` (string, optional)
    Unique identifier of the external lineage relationship.
    Example: `12345678-abcd-4ef5-9012-3456789abcdf`
  - `source` (object, optional)
    Source object of the external lineage relationship.
    - `table` (object, required)
      - `name` (string, optional)
    - `path` (object, required)
      - `url` (string, optional)
    - `model_version` (object, required)
      - `name` (string, optional)
      - `version` (string, optional)
    - `external_metadata` (object, required)
      - `name` (string, optional)
  - `target` (object, optional)
    Target object of the external lineage relationship.
    - `table` (object, required)
      - `name` (string, optional)
    - `path` (object, required)
      - `url` (string, optional)
    - `model_version` (object, required)
      - `name` (string, optional)
      - `version` (string, optional)
    - `external_metadata` (object, required)
      - `name` (string, optional)
  - `columns` (array of object, optional)
    List of column relationships between source and target objects.
    - `source` (string, optional)
    - `target` (string, optional)
  - `properties` (object, optional)
    Key-value properties associated with the external lineage relationship.

## Returns

- `id` (string, optional)
  Unique identifier of the external lineage relationship.
  Example: `12345678-abcd-4ef5-9012-3456789abcdf`
- `source` (object, optional)
  Source object of the external lineage relationship.
  - `table` (object, required)
    - `name` (string, optional)
  - `path` (object, required)
    - `url` (string, optional)
  - `model_version` (object, required)
    - `name` (string, optional)
    - `version` (string, optional)
  - `external_metadata` (object, required)
    - `name` (string, optional)
- `target` (object, optional)
  Target object of the external lineage relationship.
  - `table` (object, required)
    - `name` (string, optional)
  - `path` (object, required)
    - `url` (string, optional)
  - `model_version` (object, required)
    - `name` (string, optional)
    - `version` (string, optional)
  - `external_metadata` (object, required)
    - `name` (string, optional)
- `columns` (array of object, optional)
  List of column relationships between source and target objects.
  - `source` (string, optional)
  - `target` (string, optional)
- `properties` (object, optional)
  Key-value properties associated with the external lineage relationship.

## Request

```json
{
  "columns": [
    {
      "source": "transaction_id",
      "target": "id"
    },
    {
      "source": "amount",
      "target": "revenue"
    }
  ],
  "properties": {
    "refresh_enabled": "true",
    "refresh_frequency": "daily"
  },
  "source": {
    "table": {
      "name": "main.sales.transactions"
    }
  },
  "target": {
    "external_metadata": {
      "name": "sales_dashboard"
    }
  }
}
```

## Response

```json
{
  "columns": [
    {
      "source": "transaction_id",
      "target": "id"
    },
    {
      "source": "amount",
      "target": "revenue"
    }
  ],
  "id": "12345678-abcd-4ef5-9012-3456789abcdf",
  "properties": {
    "refresh_enabled": "true",
    "refresh_frequency": "daily"
  },
  "source": {
    "table": {
      "name": "main.sales.transactions"
    }
  },
  "target": {
    "external_metadata": {
      "name": "sales_dashboard"
    }
  }
}
```

