Mailjet logo Mailjet automation · runs weekly

Exclude inactive Mailjet contacts from campaigns

Your list keeps growing, but part of it stopped opening anything months ago and ignored your reconfirmation email. Cleaning it means a segment, a check and a bulk action in the Dashboard.

Cotlet does it in your own Mailjet account with create_segment, list_contacts and unsubscribe_contacts, called by your AI agent, an n8n workflow or a script.

Hosted · nothing to install or maintain

Can Mailjet do this on its own?

Mailjet describes this as a routine you run by hand: an activity segment, a re-engagement campaign, then removing or excluding who did not confirm (checked 22 Oct 2026). The REST API has endpoints for segments and for managing many contacts, so a script can do it. The official MCP server is read-only and cannot change a contact.

How you do it in Mailjet today

  1. Go to Contacts, then Segmentation, click Create a segment and add "Not opened in the last X days" and "Not clicked in the last X days" with your window. Mailjet suggests 3, 6 or 12 months, depending on how often you send.
  2. Send the segment a short re-engagement campaign with a button such as "Yes, keep me subscribed". Keep the unsubscribe link in it.
  3. After the send, open the campaign statistics, go to the Links tab and export the contacts who clicked the button. Their click is your proof of consent.
  4. Make a second segment of the contacts who did not click the campaign. Open your contact list, select those contacts, click Actions and choose Unsubscribe, or Exclude from Campaigns to stop every campaign.
  5. Repeat for each contact list: unsubscribing a contact from one list affects only that list.

How to exclude inactive Mailjet contacts from campaigns

Prompt

In Mailjet, find subscribers on my Newsletter list who have not opened anything in 180 days and did not click "Yes, keep me subscribed" in the Reconfirm October campaign. Show me how many there are, then exclude them from campaigns.
  1. 01

    Build the segment of non-responders

    create_segment combines three filters with "all": not opened in the last 180 days, not clicked the reconfirmation campaign, and subscribed to the list. The agent adds the subscribed filter every time, so people who already left are not counted.

  2. 02

    Look before anything changes

    list_contacts with the segment name returns the matching contacts. The agent reports the total and the first three addresses, then asks you to confirm, because the next step cannot be undone with one click.

  3. 03

    Pick the scope

    unsubscribe_contacts with scope "list" unsubscribes the contacts from one list and keeps them on it. With scope "exclusion_list" it adds them to the Campaign Exclusion List, so they get no campaign from any list. The agent uses the scope you named and asks when you did not.

  4. 04

    Run it with your OK

    unsubscribe_contacts applies the scope to the whole segment. It cuts people off from your mail, so it waits for your OK by default.

  5. 05

    Report the numbers

    The agent reports how many contacts were excluded and which window and campaign it used, so you can repeat the rule next month.

What you get back

Example data

Segment "No answer to reconfirmation": 197 contacts
First 3: sam@example.com, lena@example.org, omar@example.net
Excluded from campaigns after your OK: 197
Rule: not opened in 180 days, did not click Reconfirm October

Other ways to ask

  • Do the same with 365 days and only show me the count, do not exclude anyone.
  • Unsubscribe them from the Newsletter list only, and leave the other lists alone.
  • Create the segment "Inactive 180 days" and stop, I will review it in the Dashboard.
  • On the first Monday of each month, exclude contacts inactive for 180 days and send me the count.

What Mailjet allows, and what to know first

  • A contact on the Campaign Exclusion List gets no campaign and no automation email, because Mailjet counts automation emails as marketing, but still gets transactional email.
  • Unsubscribing a contact from one list does not unsubscribe them from the other lists.
  • On the Free plan every stored contact counts toward the 1,000 limit, including excluded ones, and only deleting contacts from All Contacts lowers the count.
  • Deleting a contact is permanent and anonymizes it at once, so the agent excludes or unsubscribes and never deletes.
  • The "not opened" and "not clicked" filters are dynamic and need open and click tracking switched on in your account settings.

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

Sources: Mailjet Help: How to send a re-engagement campaign? · Mailjet Help: Managing your contact lists · Mailjet Help: Campaign Exclusion List · Mailjet Help: Understanding Mailjet Free Plan Limits · Mailjet Help: How to delete one or multiple contacts?

Call unsubscribe_contacts from a script

curl

curl -X POST https://cotlet.dev/api/v1/mailjet/contacts/unsubscribe \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"segment":"No answer to reconfirmation","scope":"exclusion_list"}'

Example response

{
  "scope": "exclusion_list",
  "segment": "No answer to reconfirmation",
  "excluded": 197
}

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

Schedule it in n8n, Make, Zapier or cron

Mailjet tools this automation uses

Cotlet Mailjet tools used to exclude inactive Mailjet contacts from campaigns
Tool Parameters
create_segment name, match, conditions, list_id
list_contacts list_id, segment, search, cursor
unsubscribe_contacts scope, list_id, segment, emails
All 14 Mailjet tools with descriptions

Frequently asked questions

Is it safe to connect Mailjet to Cotlet?

Yes. You sign in to Mailjet yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Mailjet 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 Mailjet.

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