Mautic automation · runs weekly
Add Mautic contacts to segments in bulk
A webinar brings a few dozen new contacts into one Mautic segment, and someone has to copy the right ones into the newsletter segment before Friday's send.
Cotlet does it in your own Mautic account with list_segments, list_segment_contacts, get_contact and change_contact_segments, 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 does this by hand with the Change Segments batch action, or by a filter on a dynamic segment (checked 23 Oct 2026). A filter works only on fields marked Available for Segments, and it cannot read your own rule about which contacts count. The REST API needs to be enabled with OAuth2 or basic auth first.
How you do it in Mautic today
- In Contacts, use the search filters to find the records you want.
- Tick their checkboxes, then click the green arrow at the top of the column.
- Choose Change Segments, pick the segments to add to or remove from, then click Save.
- For a single contact, open the Contact record, click the arrow at the top right, choose Preference, then Segments.
- A dynamic segment cannot take hand-picked members, so the rule has to be a filter on the Filters tab, and only fields set to Available for Segments = Yes show up there.
How to add Mautic contacts to segments in bulk
Every Monday, take contacts who joined the webinar-leads segment this week and add them to the newsletter segment, unless they are Do Not Contact. - 01
Read the source segment
list_segment_contacts returns the members of webinar-leads page by page. The agent keeps those whose join date falls in the week and drops the rest.
- 02
Skip contacts who opted out
get_contact shows do_not_contact for each candidate. Anyone marked Do Not Contact stays out of the newsletter segment, because adding them would only create a send Mautic then blocks.
- 03
Check the target type
list_segments shows whether newsletter is static. If it is dynamic, the agent stops and tells you to change the filter instead, since a filter decides its members.
- 04
Add them in one call
change_contact_segments puts all the chosen contacts into newsletter at once. It reaches nobody by itself and one call with remove undoes it, so it does not wait for your OK.
- 05
Warn about campaigns
If a campaign starts from the newsletter segment, the agent says so in the report, because new members may get that campaign's first email.
What you get back
Contacts in webinar-leads this week: 64
Added to newsletter: 58
Skipped 5 (Do Not Contact)
Skipped 1 (already in newsletter)
Campaign starting from newsletter: Welcome series Other ways to ask
- Remove contacts from the newsletter segment who have not read an email in 90 days, and list them first.
- Add every contact with more than 50 points to the sales-ready segment, daily.
- Show which segments each contact from this CSV belongs to, and change nothing.
What Mautic allows, and what to know first
- Mautic's Change Segments batch action adds contacts to or removes them from static segments; a dynamic segment takes its members from filters on its Filters tab.
- A segment set to Active = No cannot be used elsewhere in Mautic, but it still appears in the segment list.
- Segments can also be filled by a campaign action, Modify Contact's Segments, by a form submit action or by a CSV import with the segment picked at the top.
- In the Contacts search bar, segment:segment-alias lists the members of a segment.
change_contact_segments changes only your own Mautic data and reach no one else, so it runs without asking first.
Sources: Mautic Documentation: Managing Segments · Mautic Documentation: Managing Contacts
Call change_contact_segments from a script
curl -X PATCH https://cotlet.dev/api/v1/mautic/contact-segments \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contact_ids":[1042,1388,1410],"add":["newsletter"]}' {
"updated": 3,
"added": [
"newsletter"
],
"removed": []
} MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is mautic_write → change_contact_segments. Example data.
Schedule it in n8n, Make, Zapier or cronMautic tools this automation uses
| Tool | Parameters |
|---|---|
| list_segments | none |
| list_segment_contacts | segment_id, limit, cursor |
| get_contact | contact_id |
| change_contact_segments | contact_ids, add, remove |
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.