There is no uniqueness constraint to rely on
Pipedrive's UI offers duplicate detection and merge tools for humans; the API does not enforce anything. POST /api/v2/persons with an email that already exists returns 201 with a new ID, and nothing in the response hints that a near-identical record is sitting next to it.
Duplicates therefore arrive from four predictable places: a workflow retry after a timeout where the original write actually succeeded, a webhook delivered more than once, two workflows processing the same source event, and a backfill re-run over records it already imported. All four are normal operating conditions, not edge cases.
Search first, on an exact match
The baseline pattern is a search on the identifying attribute, restricted to an exact match and to the field that actually identifies the record, followed by a branch. Searching without exact_match returns fuzzy hits and a workflow that treats any non-empty result as a match will happily attach a new deal to the wrong person.
Decide explicitly what an ambiguous result means. Zero hits is a create. One hit is an update. More than one hit is not a case to resolve by taking the first item — that choice is arbitrary and will be wrong eventually. Route it to a review branch.
GET https://COMPANY.pipedrive.com/api/v2/persons/search
?term=ada@example.com&fields=email&exact_match=true&limit=10
x-api-token: YOUR_TOKEN
# -> { "success": true,
# "data": { "items": [ { "result_score": 1.0,
# "item": { "id": 456, "name": "Ada Lovelace" } } ] } }
# items empty -> POST /api/v2/persons
# exactly one item -> PATCH /api/v2/persons/456
# more than one -> review branch; do NOT take items[0]
# fields=email matters: a bare term search matches names and notes too,
# and will "find" people who merely mention the address.
Search-then-create still has a window
Between the search returning empty and the create completing, another execution can search, also find nothing, and also create. Two concurrent webhook deliveries for the same form submission produce exactly this, and the narrower the gap the more it looks like an intermittent bug that resists reproduction.
Serialising the workflow removes the race and usually costs too much throughput to be acceptable. The better answer makes the operation idempotent so that running it twice is harmless.
A deterministic key stored on the record
Create a text custom field on the object to hold an idempotency key, and derive that key from the source event rather than generating it at runtime. Source plus submission ID is the canonical shape. A retry of the same event computes the same key, finds its own earlier write, and stops; a genuinely new event computes a different key and proceeds.
A random UUID generated inside the workflow defeats the entire mechanism, because a retry generates a new one and the search finds nothing. The key must be a function of the input, not of the execution.
Search on that field with exact_match true. This is also the pattern that makes a backfill safely re-runnable: an interrupted job restarted from the beginning re-derives the same keys for the rows it already processed and skips them, which turns a frightening partial failure into a routine re-run.
# Search on the idempotency key, not on the person
GET https://COMPANY.pipedrive.com/api/v2/deals/search
?term=webform-2026-09-14-abc123&fields=custom_fields&exact_match=true
x-api-token: YOUR_TOKEN
# data.items = [] -> safe to create
# data.items = [..] -> already processed; stop, do not create
POST https://COMPANY.pipedrive.com/api/v2/deals
{ "title": "Acme - website enquiry",
"person_id": 456,
"custom_fields": { "IDEMPOTENCY_FIELD_HASH": "webform-2026-09-14-abc123" } }
# Deterministic, derived from the event:
# key = `${source}-${submissionId}`
# A runtime-generated UUID makes a retry look like a new event.
Normalise before comparing, and clean up what already leaked
Exact-match search is exact. "Ada@Example.com " with a capital and a trailing space does not match "ada@example.com", so the search misses and the create succeeds — producing the duplicate the search existed to prevent. Trim and lowercase email addresses, normalise phone numbers to a single format, and strip legal suffixes consistently from organization names before either searching or writing.
For duplicates already in the data, resolve them in Pipedrive's UI with its merge tool rather than by deleting through the API. Merging preserves the activities, notes and deals attached to the losing record; deleting does not, and the loss is not recoverable.
Fix normalisation before adding idempotency. An idempotency key computed from an unnormalised value is just a more elaborate way to produce the same duplicates.
Controls that reduce the window without serialising everything
Idempotency keys handle retries of the same event perfectly and do nothing about two genuinely different events arriving at once for the same person — a form submission and a chat transcript, seconds apart, each creating the contact they could not find. That case needs a different control.
The cheapest is a short deduplication window on your own side: a small store keyed on the normalised identifier, written before the Pipedrive call and checked on entry, with entries expiring after a minute or two. A second execution arriving inside that window waits or defers rather than racing. This is not a distributed lock and does not need to be — it only has to cover the gap between search and create.
Where the volume justifies it, route all writes for a given identifier through a single queue partitioned on that identifier, so operations on one person are serialised while different people proceed in parallel. That removes the race entirely without the throughput cost of serialising the whole workflow.
Whatever the control, keep the search-then-create logic as well. Concurrency protection stops simultaneous creates; it does nothing about a record created last month by a different process, and the search is what catches that.
Where these facts come from