---
updatedAt: 2026-05-27T12:52:31.000Z
agentTools:
  projectIndex: https://developer.onetrust.com/onetrust/llms.txt
---

# Create Relationship

Use this API to create a bidirectional link between an inventory and one or more other inventories.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Platform - Inventory",
    "version": "1.0",
    "contact": {
      "name": "OneTrust Support",
      "url": "https://my.onetrust.com/s/contactsupport"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "description": "The Inventory APIs are used to manage relationships and link data within the inventory."
  },
  "servers": [
    {
      "url": "https://{hostname}",
      "variables": {
        "hostname": {
          "default": "hostname",
          "description": "The OneTrust hostname such as app.onetrust.com, app-eu.onetrust.com, app-de.onetrust.com, app-uk.onetrust.com, app-apac.onetrust.com, trial.onetrust.com, or uat.onetrust.com."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Inventory Relationships V2",
      "description": "The Inventory Relationships V2 APIs are used to manage V2 inventory relationships.",
      "externalDocs": {
        "description": "OpenAPI 3.1.0 - Download Definition",
        "url": "https://developer.onetrust.com/onetrust/openapi/platform-inventory.json"
      }
    }
  ],
  "x-onetrust": {
    "spec-label": "OpenAPI 3.1.0"
  },
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "metrics-enabled": false
  },
  "paths": {
    "/api/inventory-linking/v1/inventories/relations": {
      "post": {
        "operationId": "createInventoryRelationsUsingPOST",
        "summary": "Create Relationship",
        "description": "Use this API to create a bidirectional link between an inventory and one or more other inventories.",
        "tags": [
          "Inventory Relationships V2"
        ],
        "x-onetrust": {
          "spec-label": "https://developer.onetrust.com/onetrust/openapi/platform-inventory.json"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Relationship created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "429": {
            "description": "Too Many Requests. \nFor more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "description": "The number of seconds after which requests will be allowed again.",
                  "format": "int32"
                }
              },
              "ot-period": {
                "schema": {
                  "description": "The unit of time for which the rate limit applies",
                  "enum": [
                    "HOUR",
                    "MINUTE"
                  ]
                }
              },
              "ot-ratelimit-event-id": {
                "schema": {
                  "description": "The unique identifier for the rate-limiting event.",
                  "format": "uuid"
                }
              },
              "ot-request-made": {
                "schema": {
                  "description": "The number of requests made within the specified period.",
                  "format": "int32"
                }
              },
              "ot-requests-allowed": {
                "schema": {
                  "description": "The number of requests allowed within the specified period.",
                  "format": "int32"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "OAUTH2": [
              "INVENTORY",
              "INVENTORY_WRITE"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AssociatedAttributeValueInformation": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique identifier for the attribute option",
            "type": "string",
            "format": "uuid",
            "example": "a34ccec7-1ec0-4d65-9075-bdd0d923f1d1"
          },
          "value": {
            "description": "Attribute value",
            "type": "string",
            "example": "Text Value"
          },
          "valueKey": {
            "description": "Translation key used for localizing the value",
            "type": "string",
            "example": "attribute.option.valueKey"
          },
          "colorCode": {
            "description": "Color code associated with the option. Used for score-based attributes.",
            "type": "string",
            "example": "red"
          }
        },
        "required": [
          "value"
        ]
      },
      "AttributeValueInformation": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique identifier for the attribute option",
            "type": "string",
            "format": "uuid",
            "example": "a34ccec7-1ec0-4d65-9075-bdd0d923f1d1"
          },
          "value": {
            "description": "Attribute value",
            "type": "string",
            "example": "Text Value"
          },
          "valueKey": {
            "description": "Translation key used for localizing the value",
            "type": "string",
            "example": "attribute.option.valueKey"
          },
          "colorCode": {
            "description": "Color code associated with the option. Used for score-based attributes.",
            "type": "string",
            "example": "red"
          },
          "optionSelectionValue": {
            "description": "Selection score value linked to the option. Used for score-based or numerical-based attributes.",
            "type": "string",
            "example": "3.5"
          },
          "displayLabel": {
            "description": "Display name for the option, used for external attributes managed by other systems",
            "type": "string",
            "example": "United State | San Francisco"
          },
          "associatedAttributeValueInformation": {
            "description": "Associated attribute option information",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssociatedAttributeValueInformation"
            }
          },
          "disabled": {
            "description": "Indicates whether this attribute option is currently disabled.",
            "type": "boolean",
            "example": false,
            "default": "false"
          }
        },
        "required": [
          "value"
        ]
      },
      "EntityIdAndType": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Entity id",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "type": {
            "description": "Entity type",
            "type": "string",
            "enum": [
              "assets",
              "processing-activities",
              "vendors",
              "entities",
              "data-elements",
              "data-subjects"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ]
      },
      "BasicEntityIdAndName": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Entity identifier",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "name": {
            "description": "Entity name",
            "type": "string",
            "example": "Sample Entity Name"
          }
        }
      },
      "LinkRequestDto": {
        "type": "object",
        "properties": {
          "sourceInventory": {
            "description": "Associated Source Entity Instance for given Entity Type",
            "example": {
              "id": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
              "type": "assets"
            },
            "$ref": "#/components/schemas/EntityIdAndType"
          },
          "targetInventory": {
            "description": "Associated Target Entity Instance for given Entity Type",
            "example": {
              "id": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
              "type": "assets"
            },
            "$ref": "#/components/schemas/EntityIdAndType"
          },
          "contextProcess": {
            "description": "Associated Source Entity Instance for given Entity Type",
            "example": {
              "id": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
              "name": "PA Name"
            },
            "$ref": "#/components/schemas/BasicEntityIdAndName"
          },
          "attributes": {
            "description": "Custom Attributes based on schema defined for given link type",
            "type": "object",
            "example": {
              "textAttributeName": [
                {
                  "value": "Text"
                }
              ],
              "optionBasedAttributeName": [
                {
                  "id": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
                }
              ]
            },
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AttributeValueInformation"
              }
            }
          },
          "linkTypeName": {
            "description": "Link type identifier",
            "type": "string",
            "example": {
              "linkTypeName": "Data Transfer"
            }
          },
          "linkTypeLabel": {
            "description": "Link type label",
            "type": "string",
            "example": {
              "linkTypeLabel": "Sends Data To"
            }
          }
        },
        "required": [
          "linkTypeLabel",
          "linkTypeName",
          "sourceInventory",
          "targetInventory"
        ]
      }
    },
    "securitySchemes": {
      "OAUTH2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://{hostname}/api/access/v1/oauth/token",
            "scopes": {
              "INVENTORY": "Inventory scope for external systems"
            }
          }
        }
      }
    }
  }
}
```

# Sibling pages

* [Get List of Relationships](https://developer.onetrust.com/onetrust/reference/listallinventoryrelationshipsusingpost.md)
* [Update Relationship by Type Name](https://developer.onetrust.com/onetrust/reference/updateinventoryrelationsusingentitytypename_1.md)
* [Link or Unlink Personal Data to Relationship by Type Name](https://developer.onetrust.com/onetrust/reference/linkorunlinkinventoryrelationshipsusingrelationshipusingput_1.md)
* [Get Personal Data for Relationship by Type Name](https://developer.onetrust.com/onetrust/reference/getpersonaldataforrelationshipsusingpost_1.md)
* [Update Relationship by Type ID](https://developer.onetrust.com/onetrust/reference/updateinventoryrelationsusingentitytypename.md)
* [Link or Unlink Personal Data to Relationship by Type ID](https://developer.onetrust.com/onetrust/reference/linkorunlinkinventoryrelationshipsusingrelationshipusingput.md)
* [Get Personal Data for Relationship by Type ID](https://developer.onetrust.com/onetrust/reference/getpersonaldataforrelationshipsusingpost.md)
* [Get Relationship by Type Name](https://developer.onetrust.com/onetrust/reference/getinventoryrelationshipusingrelationshiptypename_1.md)
* [Delete Relationship by Type Name](https://developer.onetrust.com/onetrust/reference/deleteinventoryrelationsusingrelationshiptypename_1.md)
* [Get Relationship by Type ID](https://developer.onetrust.com/onetrust/reference/getinventoryrelationshipusingrelationshiptypename.md)
* [Delete Relationship by Type ID](https://developer.onetrust.com/onetrust/reference/deleteinventoryrelationsusingrelationshiptypename.md)