Skip to content

Run Dedup

POST
/api/leads/dedup
curl --request POST \
--url 'http://localhost:8000/api/leads/dedup?threshold=0.85&limit=2000' \
--header 'Authorization: Bearer <token>'

Analyze a BOUNDED, filtered subset of leads for duplicates (fuzzy match).

Fuzzy dedup is ~O(n^2); running it over the full DB (hundreds of thousands of rows) would hang/OOM the server. Callers scope it with filters (city/source/tier/search) and a hard limit (default 2000, max 5000), e.g. “dedup within Pune” or “dedup this source”. The UI nudges users to filter first for large datasets.

threshold
Threshold
number
default: 0.85 >= 0.5 <= 1
city
Any of:
string
source
Any of:
string
tier
Any of:
string
search
Any of:
string
limit
Limit
integer
default: 2000 >= 1 <= 5000
x-workspace-id
Any of:
string

Successful Response

Media typeapplication/json
Examplegenerated
example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}