Salesforce data sync error: Name or Email has already been taken

Issue symptoms

When I attempt to sync records from Salesforce to Zendesk, I'm getting one of these error messages: Name has already been taken with account synchronisation, or Email has already been taken for a contact or lead synchronisation. I confirmed that the organization or user in Zendesk has the correct value to match based on the matching criteria within Admin Center. Why doesn't the integration find or update that record?

Resolution steps

This error can appear for multiple reasons.

No matching record could be found based on the matching criteria

The default matching criteria rely on the name of the account in Salesforce and matches the name of the organization in Zendesk. This can be configured as documented. If the integration does not find a matching record within Zendesk, a new record will attempt to be created. The Name has already been taken error happens if the match failed, but the name of an organization you attempt to create already exists within Zendesk.
To resolve this, you can adjust the object (either the organization in Zendesk or the Account in Salesforce) to ensure the fields are set correctly to find a match. If you change data within Zendesk, you'll need to wait a minute or two before you sync the record from Salesforce again.
Another way to resolve this would be to adjust the matching criteria itself to rely on a field that's already set correctly.

Two records with the same information sync from Salesforce in a short amount of time

This could also occur if a record were created or updated in Zendesk within a few minutes before the sync from Salesforce. If the search still needs to update its index with the object's current state, the integration will attempt to create something that already exists and lead to a collision.

To resolve this, wait a few minutes for search-indexing to take place and retry the failed syncs.

A previous synchronisation is already matched to a Zendesk record

When a record first syncs from Salesforce to Zendesk with a matching criteria to identify if a record already exists, the existing record is updated. A new record is created if the integration doesn't find a matching record.

When a sync occurs, the integration saves a relationship between the source record in Salesforce and the target record in Zendesk. This relationship takes precedence over the matching criteria for future syncs. This relationship allows for a change to the matching field within Salesforce to update the existing organization within Zendesk.

To resolve this, synchronize accounts to organizations with matching criteria with the Account Name in Salesforce equal to the organization Name in Zendesk. This is the default setting.

For example, a new account is created in Salesforce with the name Spiffy Company and the organization ID: 0011H000024qFJdbic. In Zendesk, there's already an organization named Spiffy Company Incorporated with the organization ID 12345. Since the name doesn't match the Spiffy Company account, the integration creates a new organization called Spiffy Company with an organization ID that would look different, for instance, 23456. The system also stores a relationship between account 0011H000024qFJdbic and the organization ID 23456.

A different Zendesk organization already uses the name you amend your Salesforce record to

One way to resolve this conflict would be to merge the two organizations together. For more details on this step, please see this article: Merging organisations.

You can also resolve this error: Delete one of the records in Zendesk. Delete either organization 1 or 2 and then re-synchronize the account from Salesforce. If the subsequent sync doesn't have a relationship, use the matching criteria to match with the original ID.

Note: Organization deletion impacts users and tickets. Move any users that belong to the deleted organization to the new organization. Any non-closed tickets for those users will follow them to the new organization. Any closed tickets remain in the original organization and cannot be moved to a new organization. As a workaround, import closed tickets to the new organization with copies of those tickets and delete the original tickets.
To resolve this, if you cannot delete an organization or an account, contact Zendesk Customer Support Zendesk developers who can manually remove the sync relationships, individually or in bulk. When the synchronized relationships are removed, the subsequent syncs of Salesforce data will rely on the current matching criteria.