- [HTTP request](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.SearchLinksResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.aspect_1)
- [Link](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#Link)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#Link.SCHEMA_REPRESENTATION)
- [DependencyInfo](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#DependencyInfo)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#DependencyInfo.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#try-it)

Retrieve a list of links connected to a specific asset. Links represent the data flow between **source** (upstream) and **target** (downstream) assets in transformation pipelines. Links are stored in the same project as the Lineage Events that create them.

You can retrieve links in every project where you have the `datalineage.events.get` permission. The project provided in the URL is used for Billing and Quota.

### HTTP request

Choose an endpoint:
global africa-south1 asia-east1 asia-east2 asia-northeast1 asia-northeast2 asia-northeast3 asia-south1 asia-south2 asia-southeast1 asia-southeast2 asia-southeast3 australia-southeast1 australia-southeast2 europe-central2 europe-north1 europe-north2 europe-southwest1 europe-west1 europe-west10 europe-west12 europe-west15 europe-west2 europe-west3 europe-west4 europe-west6 europe-west8 europe-west9 me-central1 me-central2 me-west1 northamerica-northeast1 northamerica-northeast2 northamerica-south1 southamerica-east1 southamerica-west1 us-central1 us-central2 us-east1 us-east4 us-east5 us-east7 us-south1 us-west1 us-west2 us-west3 us-west4 us-west8 us eu   
`POST https://datalineage.googleapis.com/v1/{parent}:searchLinks`

<br />

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The project and location you want search in. It takes the form `projects/{project}/locations/{location}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "pageSize": integer, "pageToken": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "source": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`) }, "target": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`) }, "sources": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/MultipleEntityReference`) }, "targets": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/MultipleEntityReference`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `pageSize` | `integer` Optional. The maximum number of links to return in a single page of the response. A page may contain fewer links than this value. If unspecified, at most 10 links are returned. Maximum value is 100; values greater than 100 are reduced to 100. |
| `pageToken` | `string` Optional. The page token received from a previous `SearchLinksRequest` call. Use it to get the next page. When requesting subsequent pages of a response, remember that all parameters must match the values you provided in the original request. |
| The asset for which you want to retrieve links. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `source` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`)`` Optional. Send asset information in the **source** field to retrieve all links that lead from the specified asset to downstream assets. |
| `target` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`)`` Optional. Send asset information in the **target** field to retrieve all links that lead from upstream assets to the specified asset. |
| `sources` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/MultipleEntityReference`)`` Optional. Send a list of asset information in the **sources** field to retrieve all links that lead from the specified assets to downstream assets. This field is similar to the `source` `https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.request_body.FIELDS.source` field but allows providing multiple entities. All entities within the `MultipleEntityReference` must have the same `fullyQualifiedName`. |
| `targets` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/MultipleEntityReference`)`` Optional. Send a list of asset information in the **targets** field to retrieve all links that lead from upstream assets to the specified assets. This field is similar to the `target` `https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#body.request_body.FIELDS.target` field but allows providing multiple entities. All entities within the `MultipleEntityReference` must have the same `fullyQualifiedName`. |
| End of mutually exclusive fields. ||

### Response body

Response message for `https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#google.cloud.datacatalog.lineage.v1.Lineage.SearchLinks`.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "links": [ { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#Link`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `links[]` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#Link`)`` The list of links for a given asset. Can be empty if the asset has no relations of requested type (source or target). |
| `nextPageToken` | `string` The token to specify as `pageToken` in the subsequent call to get the next page. Omitted if there are no more pages in the response. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `datalineage.locations.searchLinks`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## Link

Links represent the data flow between **source** (upstream) and **target** (downstream) assets in transformation pipelines.

Links are created when LineageEvents record data transformation between related assets.

| JSON representation |
|---|
| ``` { "name": string, "source": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`) }, "target": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`) }, "startTime": string, "endTime": string, "dependencyInfo": [ { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#DependencyInfo`) } ] } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Immutable. The name of the link. Format: `projects/{project}/locations/{location}/links/{link}`. |
| `source` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`)`` The pointer to the entity that is the **source** of this link. |
| `target` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#EntityReference`)`` The pointer to the entity that is the **target** of this link. |
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The start of the first event establishing this link. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `endTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The end of the last event establishing this link. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `dependencyInfo[]` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks#DependencyInfo`)`` Optional. The dependency info of the link (applies only to column level links). |

## DependencyInfo

Dependency info describes how one entity depends on another.

| JSON representation |
|---|
| ``` { "dependencyType": enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#DependencyType`) } ``` |

| Fields ||
|---|---|
| `dependencyType` | ``enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest/v1/projects.locations.processes.runs.lineageEvents#DependencyType`)`` The type of dependency. |