Entry link types let you define custom relationship models, directional rules,
and validation constraints between entries in Knowledge Catalog. This document
describes how to create, list, update, and delete custom entry link types, or
view built-in system link types.

To connect existing data entries using these types, see
[Create and manage entry links](https://docs.cloud.google.com/knowledge-catalog/docs/manage-entry-links.md.txt).

For more information about entry link type concepts, see
[About entry link types and entry links](https://docs.cloud.google.com/knowledge-catalog/docs/entries-relationship.md.txt).

## Before you begin

Before you create and manage custom entry link types, do the following:

1. Make sure you have the required roles on the project. For details, see the [Required roles](https://docs.cloud.google.com/knowledge-catalog/docs/manage-entry-link-types.md.txt#required-roles) section of this document.
2. Set up REST authentication. For details, see the [Set up REST authentication](https://docs.cloud.google.com/knowledge-catalog/docs/manage-entry-link-types.md.txt#rest-auth) section of this document.

### Required roles


To get the permissions that
you need to create and manage entry link types,

ask your administrator to grant you the
following IAM roles on the project:

- Create, update, and delete custom entry link types: [Dataplex Entry Link Type Owner](https://docs.cloud.google.com/iam/docs/roles-permissions/dataplex.md.txt#dataplex.entryLinkTypeOwner) (`roles/dataplex.entryLinkTypeOwner`)
- Specify required aspect types (`requiredAspects`) when creating an entry link type: [Dataplex Aspect Type User](https://docs.cloud.google.com/iam/docs/roles-permissions/dataplex.md.txt#dataplex.aspectTypeUser) (`roles/dataplex.aspectTypeUser`)
- View and list entry link types: [Dataplex Catalog Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/dataplex.md.txt#dataplex.catalogViewer) (`roles/dataplex.catalogViewer`)


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).


These predefined roles contain

the permissions required to create and manage entry link types. To see the exact permissions that are
required, expand the **Required permissions** section:


#### Required permissions

The following permissions are required to create and manage entry link types:

- Create custom entry link types:
  - `dataplex.entryLinkTypes.create` on the project
  - `dataplex.aspectTypes.use` on the aspect types specified in requiredAspects
- Update mutable fields (displayName, description, labels, allowedTypes): `dataplex.entryLinkTypes.update` on the entry link type
- Delete custom entry link types: `dataplex.entryLinkTypes.delete` on the entry link type
- View entry link types: `dataplex.entryLinkTypes.get` on the entry link type
- List entry link types: `dataplex.entryLinkTypes.list` on the project


You might also be able to get
these permissions
with [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles.md.txt) or
other [predefined roles](https://docs.cloud.google.com/iam/docs/roles-overview.md.txt#predefined).

### Set up REST authentication

To simplify calling the Knowledge Catalog REST API, define an alias for
`curl` that includes your authorization token and sets the request header to
JSON:

```bash
alias gcurl='curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json"'
```

## Create a custom entry link type

You can create custom entry link types to define asymmetric directional or
symmetric (non-directional) relationships between metadata entries.

Creating, updating, or deleting an entry link type initiates a long-running
operation (LRO). The operation must succeed before changes are reflected in the
entry link type.

### Create an asymmetric (directional) entry link type

Use directional entry link types when relationships have distinct source and
target roles. For example, a table depending on an upstream dataset, or a
business term defining a physical table.

```bash
gcurl -X POST "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes?entryLinkTypeId=ENTRY_LINK_TYPE_ID" \
  -d '{
    "displayName": "DISPLAY_NAME",
    "description": "DESCRIPTION",
    "directed": {
      "source": {
        "allowedTypes": {
          "names": [
            "projects/PROJECT_ID/locations/LOCATION_ID/entryTypes/SOURCE_ENTRY_TYPE_ID"
          ]
        },
        "disableAuthorizedRetrieval": true
      },
      "target": {
        "allowedTypes": {
          "names": [
            "projects/PROJECT_ID/locations/LOCATION_ID/entryTypes/TARGET_ENTRY_TYPE_ID"
          ]
        },
        "disablePermissionCheck": true,
        "disableAuthorizedRetrieval": false
      }
    },
    "labels": {
      "environment": "production"
    }
  }'
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where the entry link type is created.
- <var translate="no">LOCATION_ID</var>: the location ID where the entry link type is created (for example, `us-central1` or `global`).
- <var translate="no">ENTRY_LINK_TYPE_ID</var>: a unique identifier for the entry link type.
- <var translate="no">DISPLAY_NAME</var>: a human-readable display name for the entry link type (up to 256 characters).
- <var translate="no">DESCRIPTION</var>: a description explaining the purpose of the entry link type (up to 1,024 characters).
- <var translate="no">SOURCE_ENTRY_TYPE_ID</var>: the entry type ID allowed as the source entry in the link.
- <var translate="no">TARGET_ENTRY_TYPE_ID</var>: the entry type ID allowed as the target entry in the link.

**Configuration notes**

When configuring the source and target specifications, consider the following
settings:

- **Entry type restrictions (`allowedTypes`).** You must either set
  `allowAllTypes` to `true` to permit all entry types or specify one or more
  entry types in `allowedTypes`.

- **Creation permission bypass (`disablePermissionCheck`).** Set to `true` to
  let users create links to an entry even if they lack `write` permissions on
  it. This setting is useful for upstream dependency links where users need to
  link to datasets they don't own.

- **Lookup retrieval bypass (`disableAuthorizedRetrieval`).**

  - Set to `true` to bypass source `read` permission checks during link
    lookups.

  - Set to `false` (default) to enforce `read` authorization on traversal. If
    users lack `read` permissions on the opposite linked entry, unauthorized
    entry names and non-empty paths are redacted to `*`, and attached aspect
    data is omitted.

### Create a symmetric (non-directional) entry link type

Use symmetric (non-directional) entry link types when the relationship between
entries is bidirectional. For example, related datasets, peers, or
cross-referenced assets.

> [!NOTE]
> **Note:** Non-directional entry link types apply the same configuration symmetrically to all entries referenced by the link.

```bash
gcurl -X POST "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes?entryLinkTypeId=ENTRY_LINK_TYPE_ID" \
  -d '{
    "displayName": "DISPLAY_NAME",
    "description": "DESCRIPTION",
    "undirected": {
      "entries": {
        "allowedTypes": {
          "names": [
            "projects/PROJECT_ID/locations/LOCATION_ID/entryTypes/ENTRY_TYPE_ID"
          ]
        },
        "disablePermissionCheck": false,
        "disableAuthorizedRetrieval": false
      }
    },
    "labels": {
      "team": "analytics"
    }
  }'
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where the entry link type is created.
- <var translate="no">LOCATION_ID</var>: the location ID where the entry link type is created (for example, `us-central1` or `global`).
- <var translate="no">ENTRY_LINK_TYPE_ID</var>: a unique identifier for the custom entry link type.
- <var translate="no">DISPLAY_NAME</var>: a human-readable display name for the entry link type (up to 256 characters).
- <var translate="no">DESCRIPTION</var>: a description explaining the purpose of the entry link type (up to 1,024 characters).
- <var translate="no">ENTRY_TYPE_ID</var>: the ID of the entry type allowed in the link.

### Create an entry link type with required aspects

You can enforce mandatory aspect metadata whenever an entry link of this type is
instantiated. Defining required aspects prevents invalid relationships, ensuring
governance across teams.

```bash
gcurl -X POST "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes?entryLinkTypeId=ENTRY_LINK_TYPE_ID" \
  -d '{
    "displayName": "DISPLAY_NAME",
    "description": "DESCRIPTION",
    "directed": {
      "source": {
        "allowAllTypes": true
      },
      "target": {
        "allowAllTypes": true
      }
    },
    "requiredAspects": [
      {
        "type": "projects/dataplex-types/locations/global/aspectTypes/ASPECT_TYPE_ID"
      }
    ]
  }'
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where the entry link type is created.
- <var translate="no">LOCATION_ID</var>: the location ID where the entry link type is created (for example, `us-central1` or `global`).
- <var translate="no">ENTRY_LINK_TYPE_ID</var>: a unique identifier for the entry link type.
- <var translate="no">DISPLAY_NAME</var>: a human-readable display name for the entry link type (up to 256 characters).
- <var translate="no">DESCRIPTION</var>: a description explaining the purpose of the entry link type (up to 1,024 characters).
- <var translate="no">ASPECT_TYPE_ID</var>: the aspect type ID required for the entry link.

**Aspect requirements and constraints**

When configuring `requiredAspects`, consider the following:

- **System aspect types only.** Only system aspect types (located under
  `projects/dataplex-types/locations/global/aspectTypes/...`) can be
  configured as required aspects on entry link types. Custom aspect types
  aren't supported.

- **Immutability.** Once an entry link type is created, its `requiredAspects`
  configuration is immutable, and can't be updated or removed.

## Get an entry link type

Retrieve full configuration details of a specific entry link type.

```bash
gcurl -X GET "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes/ENTRY_LINK_TYPE_ID"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where the entry link type is created.
- <var translate="no">LOCATION_ID</var>: the location ID where the entry link type is created (for example, `us-central1` or `global`).
- <var translate="no">ENTRY_LINK_TYPE_ID</var>: the unique identifier for the entry link type.

> [!NOTE]
> **Note:** To fetch system entry link types, specify `PROJECT_ID` as `dataplex-types` and `LOCATION_ID` as `global`.

## List entry link types

List entry link types within a project and location.

```bash
gcurl -X GET "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes?pageSize=PAGE_SIZE"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID of your Google Cloud project. To list system entry link types, specify `dataplex-types`.
- <var translate="no">LOCATION_ID</var>: the location ID (for example, `us-central1` or `global`). To list system entry link types, specify `global`.
- <var translate="no">PAGE_SIZE</var>: the maximum number of entry link types to return.

## Update a custom entry link type

You can update only `displayName`, `description`, `allowedTypes`, and
`labels` after you create a custom entry link type. You can also update
`allowedTypes` incrementally to add new entry types to the allowed list. You
can't modify the directionality (`directed` or `undirected`) and
`requiredAspects` after you create a resource.

> [!NOTE]
> **Note:** You can't update system link types (for example, `synonym`, `related`, `definition`, `schema-join`) residing in `projects/dataplex-types/locations/global/`.

```bash
gcurl -X PATCH "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes/ENTRY_LINK_TYPE_ID?updateMask=displayName,description,labels" \
  -d '{
    "displayName": "NEW_DISPLAY_NAME",
    "description": "NEW_DESCRIPTION",
    "labels": {
      "LABEL_KEY_1": "LABEL_VALUE_1",
      "LABEL_KEY_2": "LABEL_VALUE_2"
    }
  }'
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where the entry link type was created.
- <var translate="no">LOCATION_ID</var>: the location ID where the entry link type was created (for example, `us-central1` or `global`).
- <var translate="no">ENTRY_LINK_TYPE_ID</var>: the unique identifier for the entry link type that you want to update.
- <var translate="no">NEW_DISPLAY_NAME</var>: the updated human-readable display name for the entry link type.
- <var translate="no">NEW_DESCRIPTION</var>: the updated description explaining the purpose of the entry link type.
- <var translate="no">LABEL_KEY_1</var>, <var translate="no">LABEL_VALUE_1</var>, <var translate="no">LABEL_KEY_2</var>, <var translate="no">LABEL_VALUE_2</var>: the keys and values for the labels you want to assign or update (for example, `tier:gold`, `status:active`).

## Delete a custom entry link type

You can't delete system entry link types (for example, `synonym`, `related`,
`definition`, and `schema-join`) residing in
`projects/dataplex-types/locations/global/`.

> [!CAUTION]
> **Caution:** Deleting a custom entry link type also deletes all existing entry links of that type.

To delete a custom entry link type, send a `DELETE` request:

```bash
gcurl -X DELETE "https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/entryLinkTypes/ENTRY_LINK_TYPE_ID"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where the entry link type was created.
- <var translate="no">LOCATION_ID</var>: the location ID where the entry link type was created (for example, `us-central1` or `global`).
- <var translate="no">ENTRY_LINK_TYPE_ID</var>: the unique identifier of the entry link type that you want to delete.

## What's next

- See [About entry link types and entry links](https://docs.cloud.google.com/knowledge-catalog/docs/entries-relationship.md.txt).
- See [Create and manage entry links](https://docs.cloud.google.com/knowledge-catalog/docs/manage-entry-links.md.txt).
- To link glossary terms without creating custom entry link types, see [Manage synonyms and related terms](https://docs.cloud.google.com/knowledge-catalog/docs/manage-glossaries.md.txt#links-terms).