Documentation
Leads
leads.find_duplicates
REST
ShippingPOST /api/v1/leads/find_duplicatesMCP tool
Liveleads.find_duplicatesExposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Leads domain.
Operating contract
Scores the shop's open leads against one lead's phone, email, name and car, strongest match first. This is the detection half of the duplicate problem — the half a machine is good at.
confidence is 0-1. Anything at or above 0.8 is what the pipeline itself badges as a likely duplicate; below about 0.5 is a coincidence of a common name and worth ignoring. reason says which signal matched, in one clause.
An empty list is a real and common answer: this lead is not a duplicate of anything.
MERGING IS NOT HERE, AND THAT IS DELIBERATE. Folding two leads together repoints nine tables and retires one of the records, and it cannot be undone by writing a value back. Report the candidates and their confidence and let a person confirm at /leads/duplicates; do not tell a shop owner the duplicates have been dealt with.
TRUNCATION: at most limit candidates come back, strongest first, and omitted says how many more cleared the confidence floor. When it is not 0, raise limit — do not conclude you have seen every duplicate.
Who may call it
- Permission
leads.accessThe caller must hold Leads at the ACT level. A read-only dashboard grant on the same section is refused.- Plan
- Every planNo plan gate. Available on every Service VIN plan.
- Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.- Rate class
readCounted against the read budget — the widest of the four.
Partial answers
omitted is how many matching records are not in the response, and 0 is a real answer meaning you have all of them. There is no cursor here — narrow the filter instead.
Do not summarise from a truncated response
Input
| Field | Type | Description |
|---|---|---|
| lead_idrequired | stringuuid | The lead to look for duplicates of, as returned by leads.list or leads.get. |
| limit | integer1–25 | How many candidates to return, 1-25. Defaults to 5. Default:5 |
Output
| Field | Type | Description |
|---|---|---|
| items | object[] | — |
| items[].lead_id | string | — |
| items[].name | string | — |
| items[].phone | string | null | — |
| items[].email | string | null | — |
| items[].status | string | — |
| items[].source | string | null | — |
| items[].created_at | string | — |
| items[].confidence | number | — |
| items[].reason | string | — |
| omitted | number | — |
Examples
Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.
export SERVICEVIN_API_KEY=svk_live_…
curl -X POST https://www.servicevin.com/api/v1/leads/find_duplicates \
-H "Authorization: Bearer $SERVICEVIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"lead_id":"9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20","limit":5}'const res = await fetch("https://www.servicevin.com/api/v1/leads/find_duplicates", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"lead_id": "9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20",
"limit": 5
}),
});
// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;import os, requests
res = requests.post(
"https://www.servicevin.com/api/v1/leads/find_duplicates",
headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
json={
"lead_id": "9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20",
"limit": 5
},
timeout=30,
)
payload = res.json()
if not res.ok:
raise RuntimeError(payload["error"]["code"])
data = payload["data"]{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "leads.find_duplicates",
"arguments": {
"lead_id": "9b2f1c6e-4a77-4d2b-9f31-0f1c9a8e5d20",
"limit": 5
}
}
}Refusals
The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.
| Status | Code | When |
|---|---|---|
| 404 | not_found | The id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both. |
| 403 | forbidden | This login does not hold leads.access. |
| 422 | validation_error | An argument was wrong. The message names the field. |
| 429 | rate_limited | Too many read calls. Back off and retry. |
| 500 | internal_error | Something failed on our side. Nothing was changed. |