# CRM Cleanse & Dedupe Edge API (v1.0.0)

> Normalize E.164 phones, clean names/companies, and fuzzy-deduplicate up to 500 CRM leads in <15ms.

Deterministic international E.164 phone parsing (40+ countries), smart name/email/company normalization, free-webmail vs. corporate domain isolation, and Jaro-Winkler + Soundex fuzzy contact deduplication.

## Why Agents Use This API Instead of DIY
Eliminates brittle regexes, trunk-zero E.164 bugs, McDonald/O'Connor casing mistakes, free-webmail false merges, and multi-turn LLM token burn over large lead lists.

## Connection & Payment (x402 Default + Optional Bearer API Key)
- **MCP Server (Streamable HTTP):** `https://crm-cleanse.apikeg.com/mcp` (Registry ID: `com.apikeg/crm-cleanse` — `initialize`, `tools/list`, `resources/*`, and `prompts/*` are free)
- **OpenAPI 3.1 Spec:** [openapi.json](https://crm-cleanse.apikeg.com/openapi.json)
- **Full Schema & Examples:** [llms-full.txt](https://crm-cleanse.apikeg.com/llms-full.txt)
- **RFC 9727 API Catalog:** [.well-known/api-catalog](https://crm-cleanse.apikeg.com/.well-known/api-catalog)
- **x402 Bazaar Manifest:** [.well-known/x402.json](https://crm-cleanse.apikeg.com/.well-known/x402.json)
- **MCP Discovery Manifest:** [.well-known/mcp.json](https://crm-cleanse.apikeg.com/.well-known/mcp.json)
- **A2A Agent Card:** [.well-known/agent-card.json](https://crm-cleanse.apikeg.com/.well-known/agent-card.json)
- **Primary Payment (Zero Signup):** Cloudflare Monetization Gateway (`HTTP 402` / `x402` v2 with USDC on Base).
- **Optional Monthly API Key:** Pass `Authorization: Bearer ak_live_...` ($5 / $20 / $50 monthly per-product Stripe plans at [apikeg.com/account](https://apikeg.com/account)).
- **Free Preflight:** Append `?dry_run=true` (or header `X-Dry-Run: true`) to validate any request payload at `$0.00` cost.

## Tools & REST Endpoints
- [`cleanse_contact_batch`](https://crm-cleanse.apikeg.com/tools/cleanse-contact-batch.md) (`POST https://crm-cleanse.apikeg.com/v1/cleanse-contact-batch`) — $0.001 base (up to $0.01 max ($0.001 minimum + $0.002 per 100 records, capped at $0.01 for up to 500 records), x402 variable settlement): Normalizes emails, international E.164 phones, person names/honorifics, and company legal suffixes across 1-500 CRM records, returning merged canonical uniqueRecords and duplicateClusters.
- [`compare_contact_pair`](https://crm-cleanse.apikeg.com/tools/compare-contact-pair.md) (`POST https://crm-cleanse.apikeg.com/v1/compare-contact-pair`) — $0.0005 USD per contact pair comparison (x402 instant micropayment): Computes field-by-field normalized similarity (email fingerprint, E.164 phone, Jaro-Winkler + Soundex name, company key, corporate domain) and returns an isMatch merge recommendation.

## Instant MCP Configuration
```json
{
  "mcpServers": {
    "crm-cleanse": {
      "type": "streamable-http",
      "url": "https://crm-cleanse.apikeg.com/mcp"
    }
  }
}
```

## Common Agent Use Cases
- deduplicate CRM contacts API
- normalize international phone numbers to E.164 MCP
- fuzzy match HubSpot Salesforce leads Jaro-Winkler
- strip company legal suffixes LLC GmbH Inc API
- cleanse B2B lead list before enrichment
