# mergeContacts

Merge duplicate contacts into one survivor. contactIds: the full set (2+); primaryContactId MUST be one of them; it keeps its custom fields and agent, absorbing the others’ notes, tags, activities, campaign slots. name: its display name; optional pointPersonUserId picks the surviving agent. Returns the survivor. Losers are retired permanently: find them with findDuplicateContactGroups or findContacts. Delegate it with approvedIrreversible and bulkChange (count and contactIds: every contact merged; summary: the one kept); that card is the one yes.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "mergeContacts", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `contactIds`: `[ID!]!` (required)
- `primaryContactId`: `ID!` (required)
- `name`: `String!` (required)
- `pointPersonUserId`: `ID`

## Response (data, an example)

```json
{
  "contactMutation": {
    "mergeContacts": {
      "id": "<ID>",
      "name": "…",
      "createdAt": "2026-01-01T00:00:00.000Z"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "mergeContacts",
    "variables": {
      "contactIds": [
        "<contactIds>"
      ],
      "primaryContactId": "<primaryContactId>",
      "name": "<String>"
    }
  }'
```
