## TL;DR
Profile merging unifies identifiers (emails, phone numbers, external ids) under one profile, and it fails when the identifiers conflict: both profiles claim the same unique identifier differently, or a merge would violate a uniqueness constraint. Read the merge error for the conflicting identifier, resolve the conflict on the profiles, then retry. Merging is only as clean as the identity data feeding it.

## The query

```text
zendesk sunshine profile merge failed
```

## Use this when

- Sunshine profile merges fail or partially apply
- Unified profiles show duplicate or conflicting data
- Merges work for some profiles but fail for others


## Not for

- Sunshine API authentication errors
- Sunshine event ingestion failures
- Ticket custom field issues


## Steps

### 1. Read the merge error for the conflict

The failed merge response names the conflicting identifier or constraint. Don't guess: fetch both profiles and compare their identifiers field by field until you find the clash.

Expected output: the specific identifier or constraint blocking the merge.

### 2. Resolve the identifier conflict first

If both profiles claim the same email with different casing or formatting, normalize them. If an external id is duplicated across profiles that shouldn't share it, fix the source system. Merge after the data agrees.

Expected output: both profiles' identifiers consistent with each other.

### 3. Retry the merge and verify unification

Run the merge again and read back the unified profile: one profile, all identifiers present, no duplicates. A merge that 'succeeds' but leaves dupes needs the same treatment as a failure.

Expected output: a single unified profile containing every identifier once.

### 4. Fix the upstream identity pipeline

Recurring merge failures mean the ingestion pipeline creates conflicting profiles faster than you merge them. Normalize identifiers at ingestion: lowercase emails, strip phone formatting, dedupe external ids.

Expected output: identifier normalization running at ingestion, not at merge time.

## Variant phrasings

### zendesk sunshine merge profiles error

Steps 1 and 2: read the conflict, fix the data.

### sunshine unified profile duplicates

Step 3's verification catches partial merges.

## Why it happens

Merging doesn't clean data; it unifies it, conflicts included. Teams treat merge as the dedup strategy, but every merge of dirty identifiers just produces a unified dirty profile. The failures are the system refusing to create an ambiguous identity, which is the correct behavior.

## Edge cases

- Merges are hard to undo. Snapshot both profiles before merging anything you can't reconstruct.
- External id collisions across tenants are a data-model bug, not a merge bug. Scope ids per tenant.
- Sunshine profiles and Zendesk users are different objects. Merging one doesn't merge the other.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_D6N7qUtIzDeLI2qIYbntGA
