POST

Merge Contacts


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Merges up to 5 source contacts into a target contact.

The current target contact revision must be passed as targetContactRevision. This ensures you're working with the latest contact and prevents unintended overwrites.

The merge behaves in one of two ways, depending on whether you provide targetContact in the request:

  • Without targetContact: The source contacts are merged into the existing target contact. Non-empty fields from the sources fill empty fields on the target, and array fields (emails, phones, and addresses) are combined and deduplicated. When you provide multiple sources, they're merged in order: the first source into the second, that result into the third, and so on, and finally into the target. Earlier sources take precedence over later ones.
  • With targetContact: The provided targetContact overwrites the target according to fieldMask, and the source contacts are deleted without their data being merged in.

In both cases, the source contacts are permanently deleted after a successful merge.

Set preview to true to return the merged result without applying it, so you can review the outcome before committing.

Restrictions:

  • Source contacts can't be site members. The target contact can be a site member.
  • externalId can be set only once and can't be changed if it already has a value.
  • The target contact must remain valid after the merge, keeping at least one of name, email, or phone.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Contacts
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/contacts/v5/contacts/{targetContactId}/merge

Errors
400Invalid Argument

There are 12 errors with this status code.

404Not Found

There is 1 error with this status code.

409Already Exists

There is 1 error with this status code.

428Failed Precondition

There are 2 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?