Request
Merges fold the duplicates into the primary contact. The primary keeps its UUID; duplicate UUIDs are retired. Non-empty fields on the primary are preserved; missing fields are filled from the duplicates in order. Notes, activities, tasks, emails, documents, and list memberships are re-homed to the primary.
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Strongly recommended. Same key returns the same result within 24 hours.
Body Parameters
UUID of the contact that will remain after the merge.
UUIDs of contacts to merge into the primary. Maximum 20 per request.
When true, non-empty fields on the primary can be overwritten by duplicate values. Defaults to fill-only behavior.
When true, the API returns a preview of the merge without making changes.
Response
The resulting contact object after the merge
UUIDs of the duplicates that were retired
Field names that were filled from duplicates
{ notes, activities, tasks, emails, documents, list_memberships } moved to the primary
Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID. Each merged duplicate emits a contact.merged webhook event.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/contacts/merge \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"primary_id": "123e4567-e89b-12d3-a456-426614174000",
"duplicate_ids": ["456e7890-a1b2-34c5-d678-901234567890"]
}'
Example Response
{
"data" : {
"primary" : {
"id" : "123e4567-e89b-12d3-a456-426614174000" ,
"full_name" : "Jane Doe" ,
"email" : "jane@acme.com" ,
"phone" : "+1-555-0100"
},
"merged_ids" : [ "456e7890-a1b2-34c5-d678-901234567890" ],
"fields_populated" : [ "phone" , "linkedin_url" ],
"counts" : {
"notes" : 3 ,
"activities" : 11 ,
"tasks" : 2 ,
"emails" : 18 ,
"documents" : 1 ,
"list_memberships" : 4
}
}
}
Errors
Status Code Description 400 validation_errorMore than 20 duplicates, or primary_id appears in duplicate_ids 401 invalid_keyInvalid or expired API key 403 insufficient_permissionsMissing write:contacts permission 404 not_foundPrimary or any duplicate ID was not found 409 merge_conflictDuplicates reference each other in a circular chain 429 rate_limitedRate limit exceeded