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