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
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:
To clone an entity with all attribute values:
|
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:
|
|
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",
...
}