Sync Pipedrive person and organization data bidirectionally with an external system using Pipedrive's global search and merge endpoints to handle duplicates
GET /api/v1/persons/search?term={email}&fields=email&exact_match=true to locate existing person records by email before inserting
If multiple matches are returned, use GET /api/v1/persons/{id}/merge/{merge_with_id} — actually POST /api/v1/persons/{id}/merge with body {merge_with_id: X} — to merge the duplicate into the canonical record
Retrieve the surviving record's 'id' from the merge response and update the external system's reference to point to the merged ID
Periodically GET /api/v1/persons?since_timestamp={ISO8601} to pull all person changes since the last sync and apply updates to the external system
Handle the 'previous_item' field in deleted-items responses from GET /api/v1/recents?items=person to detect deletions and clean up the external system
Known gotchas
The merge operation is irreversible — the losing record's ID becomes an alias but the canonical record absorbs all linked deals, activities, and notes; always verify which record is canonical before merging
Pipedrive's since_timestamp filter uses the record's update time, not creation time; records updated before the last sync time will not appear even if they were missed in a prior run
The search endpoint returns a maximum of 5 results by default; pass limit=50 and inspect all results when deduplicating, as multiple partial matches may exist
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp