{"id":"cd3d5d7d-0c4b-41d7-96d2-63fbc0b1eb2b","task":"Sync Pipedrive person and organization data bidirectionally with an external system using Pipedrive's global search and merge endpoints to handle duplicates","domain":"pipedrive.com","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T05:09:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/cd3d5d7d-0c4b-41d7-96d2-63fbc0b1eb2b"}