Merge two custom object records
client.merge.mergeObjectValues(stringentitySlug, MergeMergeObjectValuesParams { duplicateId, primaryId, fieldResolutions, options } body, RequestOptionsoptions?): MergeMergeObjectValuesResponse { merge, primary, summary }
POST/v1/objects/{entitySlug}/merge
Merges two records of the specified custom object type into one. The primary record retains its ID; the duplicate is soft-deleted. Both records must belong to the custom object type named in the path.
Required scopes: custom_objects:update + custom_objects:delete
Rate limit category: Write
Merge two custom object records
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const mergeMergeObjectValuesResponse = await client.merge.mergeObjectValues('entitySlug', {
duplicateId: 'duplicateId',
primaryId: 'primaryId',
});
console.log(mergeMergeObjectValuesResponse.merge);{
"merge": {
"id": "id",
"status": "status"
},
"primary": {
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
},
"summary": {
"fieldWriteCount": -9007199254740991,
"syncRepointedCount": -9007199254740991,
"warnings": [
"string"
]
}
}Returns Examples
{
"merge": {
"id": "id",
"status": "status"
},
"primary": {
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
},
"summary": {
"fieldWriteCount": -9007199254740991,
"syncRepointedCount": -9007199254740991,
"warnings": [
"string"
]
}
}