Accelerate the Value of Data

Clone entities

This API enables you to clone an existing entity.

A new Entity ID is assigned to the new entity. The Entity type, attribute values, and relationships are copied from the original entity.

Request

POST {TenantURL}/{entity object uri}/_clone
Table 1. Parameters
Parameter Required Description Example
Headers Authorization Yes Information about the authentication access token in the format Bearer <accessToken>. For more information, see Authentication API.
Query valuesToCopy No Enables you to specify the attributes values that must be copied, which can be OV or All. The default value is OV. To clone an entity with only OV attribute values:

valuesToCopy=OV

To clone an entity with all attribute values:

valuesToCopy=ALL

Body attributeReplacementMapping No The source entity attribute paths and new value for it in the cloned entity, which can be any one of the following:
  • Template: This value can be used as the current source entity attribute value. If you want to use the actual value of the attribute from the source entity, you can use the Copy of {value} to prefix the actual attribute value with Copy of.
  • Null: This value is used to remove target attribute in the cloned entity.
  • Replacement without a template: The fixed attribute value in the cloned entity is the same as in the request.
    Note: If the role and/or group the user is assigned to has the Create permission for the entity type but not for some of the attributes, then set these attributes to null here to avoid any errors during cloning.
{
  "attributeReplacementMapping": {
    "attributes/FirstName": "Copy of {value}",
    "attributes/LastName": "New Last Name"
  },
  "relationshipTypesToCopy": [
    "configuration/relationTypes/Friend",
    "configuration/relationTypes/HasAddress"
  ],
  "crosswalks": [
    {
      "type": "configuration/sources/AMA",
      "value": "CrosswalkValueForNewEntity"
    }
  ]
}
relationshipTypesToCopy No The relationship types that must be copied into the cloned entity.
crosswalks No The crosswalks that must be set for a cloned entity. Default crosswalks are generated if you don’t specify crosswalks here.

Response

JSON object with cloned entity.

Example 1: Clone an entity that has John as the first name and with a HasAddress relationship type, where John is the current source entity attribute value

Request

POST {TenantURL}/entities/1dys82JB/_clone
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
{
  "attributeReplacementMapping": {
    "attributes/FirstName": "Copy of {value}"
  },
  "relationshipTypesToCopy": [
    "configuration/relationTypes/HasAddress"
  ]
}

Response

{
    "uri": "entities/1dysAARB",
    "type": "configuration/entityTypes/HCP",
    ...
    "attributes": {
        "FirstName": [
            {
                "type": "configuration/entityTypes/HCP/attributes/FirstName",
                "ov": true,
                "value": "Copy of John",
                "uri": "entities/1dysAARB/attributes/FirstName/4Nb9tc8R3"
            }
        ]
        ...
    },
    "isFavorite": false,
    "crosswalks": [
        {
            "uri": "entities/1dysAARB/crosswalks/11f2882e-4e08-4621-8bca-88cb6b5ac976",
            "type": "configuration/sources/Reltio",
            "value": "1dysAARB",
            ...
}

Example 2: Clone an entity without a first name and a new last name

Request

POST {TenantURL}/entities/1dys82JB/_clone
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
{
  "attributeReplacementMapping": {
    "attributes/LastName": "New Last Name",
    "attributes/FirstName": null
  }
}

Response

{
    "uri": "entities/1dysAARB",
    "type": "configuration/entityTypes/HCP",
    ...
    "attributes": {
        "LastName": [
            {
                "type": "configuration/entityTypes/HCP/attributes/LastName",
                "ov": true,
                "value": "New Last Name",
                "uri": "entities/1dysAARB/attributes/FirstName/3Nb9tc8R1"
            }
        ]
    },
    "isFavorite": false,
    "crosswalks": [
        {
            "uri": "entities/1dysAARB/crosswalks/11f2882e-4e08-4621-8bca-88cb6b5ac976",
            "type": "configuration/sources/Reltio",
            "value": "1dysAARB",
            ...
}