Mautic logo Mautic automation · runs weekly

Merge duplicate Mautic contacts

After a CSV import and a few webinar forms, the same person sits in Mautic twice, once with their old email and once with a new one, and every campaign emails both.

Cotlet does it in your own Mautic account with list_contacts, get_contact, get_contact_history and merge_contacts, called by your AI agent, an n8n workflow or a script.

Hosted · nothing to install or maintain

Can Mautic do this on its own?

Mautic merges one pair at a time from the contact page (checked 23 Oct 2026). It matches duplicates on the fields of its duplicate-matching operator, AND by default or OR if you change it under Contact Merge. The REST API is off by default and needs OAuth2 or basic auth set up first. Nothing in the documentation lists likely duplicate pairs for you.

How you do it in Mautic today

  1. On the Contact detail page, click the drop down box arrow at the top right and choose the Merge item.
  2. Search for the other contact, then press the Merge button.
  3. To find the pairs first, scan the Contacts list by hand, or open each contact History and look for Imported, Added through API and Form Submitted events to see where the second record came from.
  4. Under Settings > Configuration, the Contact Merge setting decides whether the duplicate-matching operator is AND (the default) or OR.
  5. The scan and the merges repeat after every import, because nothing lists the pairs for you.

How to merge duplicate Mautic contacts

Prompt

Find duplicate contacts in Mautic with the same name and a similar email, keep the one with more points and merge the other into it. Leave unclear pairs for me.
  1. 01

    Collect candidates

    Your agent reads the contacts page by page with list_contacts and groups them by lowercased email and by name plus company. Pairs that share a name but not a company or an email domain go to the unclear pile, not to a merge.

  2. 02

    Compare each pair

    For every pair, get_contact brings both records. The agent keeps the contact your rule prefers, for example the one with more points, and notes which custom fields only the other one has filled.

  3. 03

    Check where the copy came from

    get_contact_history shows the Imported, Contact Created By Source and Form Submitted events of the second record. A copy made by an import of the same list is a safe merge; a copy from a different form may be another person with the same name.

  4. 04

    Merge, one pair at a time

    merge_contacts runs from the contact you keep. Each call waits for your OK by default, because the agent cannot undo a merge. An ID that is gone fails before anything changes.

  5. 05

    Stop on changed pairs

    Right before merging, the agent reads both contacts again. If either one changed, for example a form fill added points, it skips the pair and lists it for you.

What you get back

Example data

Contacts scanned: 480
Duplicate pairs found: 7
Merged 5 (same email, one from the webinar-signups.csv import)
Left for you 2:
- Tom Becker: two companies, two email domains
- Maria Silva: second record came from a different form

Other ways to ask

  • Only check contacts added in the last 30 days, and list the pairs without merging.
  • Merge pairs with the same email when one has an Imported event and the other a Form Submitted event, keep the form one.
  • After each import, report how many of the imported contacts already existed.

What Mautic allows, and what to know first

  • Mautic's duplicate-matching operator is AND by default, so two contacts match only when all the matching fields agree; switching it to OR under Contact Merge matches on any one field.
  • Mautic's contact History records how each record arrived, with events such as Imported, Added through API and Contact Created By Source.
  • Mautic's Delete Selected batch action handles at most 100 contacts per run, so deleting duplicates by hand is slower than merging them.
  • Contact page menu items Segments and Campaigns show a green switch where the contact is a member, so you can see what a duplicate was subscribed to before merging.

merge_contacts asks for your OK by default. To run it weekly without you, switch confirmation off for that tool in your dashboard.

Sources: Mautic Documentation: Managing Contacts · Mautic Developer Documentation: Getting started with the REST API

Call merge_contacts from a script

curl

curl -X POST https://cotlet.dev/api/v1/mautic/duplicates/2217/contacts/1042/merge \
  -H "Authorization: Bearer $COTLET_API_KEY"

Example response

{
  "merged": true,
  "contact_id": 1042,
  "removed_contact_id": 2217
}

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is mautic_write → merge_contacts. Example data.

Schedule it in n8n, Make, Zapier or cron

Mautic tools this automation uses

Cotlet Mautic tools used to merge duplicate Mautic contacts
Tool Parameters
list_contacts search, limit, cursor
get_contact contact_id
get_contact_history contact_id, include, exclude, cursor
merge_contacts contact_id, duplicate_id
All 15 Mautic tools with descriptions

Frequently asked questions

Is it safe to connect Mautic to Cotlet?

Yes. You sign in to Mautic yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Mautic once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

Give your agent access to Mautic.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Mautic.