close.mergeLeads merge a source Close lead into a destination lead.
automations/close-merge-leads.automation.ts
Inputs
Provide distinctsourceLeadId and destinationLeadId values. Close moves the source lead’s child records into the destination.
Close performs merges asynchronously. Automate.ax submits the merge once, then checks its LeadMerge activity after durable delays until Close reports completion. maxPolls defaults to 60 and accepts integers from 1 to 120. pollInterval defaults to "2s" and accepts a duration string or milliseconds. The action fails with Close’s merge error or when the polling budget is exhausted.
Optional second argument { account } selects a named Close binding.
Output
Returns{ merged: true, sourceLeadId, destinationLeadId } only after Close reports the merge as completed. The source lead no longer remains as an independent record, so dependent actions can safely use destinationLeadId.