HigherData / Tool
hygiene.merge
Plan a change set to fill the surviving HubSpot record and merge the other records in one duplicate group. A dry run returns the plan without saving or applying it. Set execute: true to approve and apply the merge in HubSpot. The merge cannot be undone.
Scopes: crm:write
Send execute false to preview the change. Send execute true to write it. A preview does not change stored data.
REST: POST /api/v1/tools/hygiene.merge?execute=false. The same call is POST /api/v1/hygiene/merge?execute=false.
MCP tool name: hygiene_merge. It is in the default MCP catalog when your scopes allow it.
Input
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Duplicate group id. UUID. |
| winnerId | string | no | CRM id of the record that survives. Omit it to let survivorship choose. Pattern: ^[1-9][0-9]{0,19}$. |
| overrides | object | no | Property values to force onto the surviving record. Keys are CRM property names. |
Output
| Field | Type | Required | Description |
|---|---|---|---|
| dryRun | boolean | yes | |
| winnerId | string | yes | CRM record id. Pattern: ^[1-9][0-9]{0,19}$. |
| loserIds | array | yes | 1 to 49 items. Each item: Pattern: ^[1-9][0-9]{0,19}$. |
| fields | array | yes | At most 32 items. |
| associations | array | yes | At most 2450 items. |
| restoreWarning | string | yes | |
| changeSetId | value | yes | |
| mergeProgress | array | no | |
| comparison | object | no | |
| comparison. | string | yes | One of: companies, contacts. |
| comparison. | string | yes | Pattern: ^[1-9][0-9]{0,15}$. |
| comparison. | array | yes | 2 to 50 items. |
| comparison. | array | yes | At most 48 items. |
| comparison. | object | yes |
Request
curl -sS -X POST "https://higherdata.io/api/v1/tools/hygiene.merge?execute=false" \
-H "Authorization: Bearer hd_example_replace_me" \
-H "Content-Type: application/json" \
-d '{
"id": "11111111-1111-4111-8111-111111111111",
"winnerId": "11",
"overrides": {
"name": "Acme Works"
}
}'SDK
import { HigherData } from "higherdata-sdk";
const higherdata = new HigherData({
apiKey: "hd_example_replace_me",
apiUrl: "https://higherdata.io",
});
const result = await higherdata.call("hygiene.merge", {
"id": "11111111-1111-4111-8111-111111111111",
"winnerId": "11",
"overrides": {
"name": "Acme Works"
}
}, { execute: false });Example
{
"input": {
"id": "11111111-1111-4111-8111-111111111111",
"winnerId": "11",
"overrides": {
"name": "Acme Works"
}
},
"output": {
"dryRun": true,
"winnerId": "11",
"loserIds": [
"12"
],
"fields": [
{
"field": "name",
"before": "Acme",
"after": "Acme Works",
"source": "override",
"sourceId": null,
"reviewed": true
}
],
"associations": [],
"restoreWarning": "Rebuild: restoring this merge creates the losing record under a new CRM ID. Mapped properties and supported associations can be restored. Activities and unmapped properties are not restored. It cannot reverse the merge.",
"changeSetId": null
}
}