# Search Duplicate Contacts

Searches potential duplicate contact pairs with detection reason and confidence, cursor-paginated. Defaults to open pairs; a pair can appear from both sides. Merging or rejecting happens in the app; merging deletes the duplicate contact without undo.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "open, rejected, completed or all; default open",
      "default": "open",
      "enum": [
        "open",
        "rejected",
        "completed",
        "all"
      ]
    },
    "probability": {
      "type": [
        "null",
        "string"
      ],
      "description": "Only this detection level: middle, high, very-high, maximum or manual; omit for every level",
      "default": null,
      "enum": [
        "middle",
        "high",
        "very-high",
        "maximum",
        "manual"
      ]
    },
    "contactId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Only duplicates of this primary contact",
      "default": null,
      "minimum": 1
    },
    "cursor": {
      "type": [
        "null",
        "string"
      ],
      "description": "Opaque nextCursor value of the previous result page; omit for the first page",
      "default": null,
      "maxLength": 500
    },
    "pageSize": {
      "type": "integer",
      "description": "Maximum duplicates on the page, from 1 through 50",
      "default": 25,
      "minimum": 1,
      "maximum": 50
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "count",
    "hasNextPage",
    "nextCursor",
    "duplicates",
    "duplicatesUrl"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "count": {
      "type": "integer"
    },
    "hasNextPage": {
      "type": "boolean"
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "duplicates": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "duplicateRecordId",
          "contactId",
          "contactEmail",
          "duplicateContactId",
          "duplicateContactEmail",
          "probability",
          "detectedBy",
          "status",
          "detectedAt",
          "reviewUrl"
        ],
        "properties": {
          "duplicateRecordId": {
            "type": "integer"
          },
          "contactId": {
            "type": "integer"
          },
          "contactEmail": {
            "type": "string"
          },
          "duplicateContactId": {
            "type": "integer"
          },
          "duplicateContactEmail": {
            "type": "string"
          },
          "probability": {
            "type": "string",
            "enum": [
              "middle",
              "high",
              "very-high",
              "maximum",
              "manual"
            ]
          },
          "detectedBy": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "rejected",
              "completed"
            ]
          },
          "detectedAt": {
            "type": "string"
          },
          "reviewUrl": {
            "type": "string"
          }
        }
      }
    },
    "duplicatesUrl": {
      "type": "string"
    }
  }
}
```

