# findDuplicateContactGroups

Every duplicate group (same name + shared phone or email) in ONE call, never contact by contact. matchBy: NAME = name alone, unverified, each group listing the phones and emails its members share (reserved domains too); tagIds = groups with a contact carrying one of these tags or on one of these lists. It skips emails on reserved domains (example.com, .test; reservedEmailGroupCount counts the same-name groups sharing only one) and misses name variants: never say a group shares no phone or email, nor call the account duplicate-free. Confirm, then mergeContacts per group.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "findDuplicateContactGroups", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no
- Result cap: `limit` is clamped to 100, without an error

## Variables

- `limit`: `Int` (default `50`)
- `offset`: `Int` (default `0`)
- `matchBy`: `DuplicateContactMatch` (default `NAME_AND_CONTACT_INFO`, one of `NAME_AND_CONTACT_INFO`, `NAME`)
- `tagIds`: `[ID!]`

## Response (data, an example)

```json
{
  "contactQuery": {
    "duplicateContactGroups": {
      "groups": [
        {
          "contacts": [
            {
              "id": "<ID>",
              "name": "…"
            }
          ],
          "sharedPhoneNumbers": [
            "…"
          ],
          "sharedEmails": [
            "…"
          ]
        }
      ],
      "totalCount": 0,
      "truncated": true,
      "hasMore": true,
      "reservedEmailGroupCount": 0
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "findDuplicateContactGroups",
    "variables": {}
  }'
```
