Merge two contacts
client.merge.mergeContacts(MergeMergeContactsParams { duplicateId, primaryId, fieldResolutions, options } body, RequestOptionsoptions?): MergeMergeContactsResponse { merge, primary, summary }
POST/v1/contacts/merge
Merges two contacts into one. The primary contact retains its ID; the duplicate is soft-deleted.
Required scopes: contacts:update + contacts:delete
Rate limit category: Write
Merge two contacts
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const mergeMergeContactsResponse = await client.merge.mergeContacts({
duplicateId: 'duplicateId',
primaryId: 'primaryId',
});
console.log(mergeMergeContactsResponse.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"
]
}
}