Skip to contentSkip to navigation

Merge Leads Beta

Merge one lead into another and delete the duplicate.

POST /api/v1/leads/merge

Requires an API key with the write scope.

Merges the secondary lead into the primary lead, in one transaction, then deletes the secondary (a soft delete, like Bulk Delete Leads). Both leads must be live leads of the workspace.

What moves to the primary

  • Campaign memberships. A membership in a campaign only the secondary was in moves to the primary with its progress and queued sends. When both leads are in the same campaign, the further progressed membership is kept and the other is dropped with its queued sends, so the person is not emailed twice. Progress is compared in this order: replied, the later sequence step, more emails sent, the later last send, then the primary's. The campaign's lead count goes down by one for each dropped membership.
  • History. Email history, replies (with their inbox notes), and Lead Finder reveals now point at the primary.
  • Tags and labels. The primary ends up with the union of both leads' tags and labels.
  • Fields. First name, last name, company, title, phone, LinkedIn URL, website and source are filled from the secondary only where the primary's is empty. Custom fields work the same way, key by key. The secondary's notes are appended to the primary's after a --- line. The interest status and the owner are taken from the secondary only when the primary has none.
  • Opt-out. If the secondary is unsubscribed, the primary becomes unsubscribed and an audit.lead.status_changed entry is written. A bounced status does not carry over, because it describes the secondary's address.

An audit.lead.merged entry (actor, time, both lead ids and the counts, no email addresses) is written in the same transaction and is visible through GET /api/v1/events. Events recorded before the merge keep the secondary's id, and a lead webhook is not sent for a merge.

Request Body

primaryLeadId string body required
The lead that survives.
secondaryLeadId string body required
The lead merged into the primary and deleted. It must differ from the primary.

Response

data object
Merge result
primaryLeadId string
The surviving lead.
secondaryLeadId string
The deleted lead.
status string
merged.
moved object
Counts of campaignLeads, emailLogs, replies, reveals, tags (added to the primary) and labels (added to the primary).
dropped object
{ "campaignLeads": 1 }: memberships dropped because both leads were in that campaign.
statusCarried boolean
true when the primary became unsubscribed because the secondary was.

Errors

StatusDescription
401Missing, invalid, revoked or expired API key
403API key does not have the required scope: write
404A lead was not found in the workspace, or is deleted
409lead_mid_send: an email to one of the leads is being sent right now. Try again in a minute. Nothing was changed
422Both ids are the same lead, or the merged custom fields would exceed 50 keys. Nothing was changed

Rate Limit

  • 120 requests per minute, shared by every write call in your workspace. Fixed 60-second window.
  • Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (unix epoch seconds) and X-RateLimit-Bucket (write).
  • A 429 response includes a Retry-After header (seconds until the bucket resets).

For client-side patterns, see Rate Limiting.

Was this page helpful?