Run Dedup
POST
/api/leads/dedup
const url = 'http://localhost:8000/api/leads/dedup?threshold=0.85&limit=2000';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Header Parameters
Section titled “Header Parameters”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Examplegenerated
exampleValidation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
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" } ]}