Advanced segments
An advanced segment’s membership is set by its definition. You send a definition when you create or update a segment with POST /3.0/segments or PATCH /3.0/segments/{segment_id}, and GET /3.0/segments/{segment_id} returns it. Working with advanced segments requires a Mailchimp plan that includes advanced segmentation.
A definition is a tree:
- Groups combine their children with AND or OR.
- Conditions each test one thing about a contact, such as an email address, a tag, a campaign they opened or a purchase they made.
- The root of the tree is always a group. It may also say which contacts are in scope at all (the
contactsobject).
This selects subscribed email contacts whose address contains @example.com and who either carry tag 8662415 or have a contact rating above 3.
Read-only segments
Every segment in a list or a read carries read_only:
When you create a segment, definition is required, and its root group must have match and conditions. When you read one, definition is present only if read_only is false. read_only can’t be sent in a PATCH.
Creating an advanced segment, or updating or taking a snapshot of one, requires an account whose plan includes advanced segmentation. Without it, those requests return a 403. Snapshots of read-only segments don’t need it.
The rest of this page describes definitions, so it applies to segments that aren’t read-only.
Compatibility
Within an API version, existing fields keep their names, types and meaning, and aren’t removed. Mailchimp may add new fields, both to responses and to definitions, without a new version. Ignore fields you don’t recognize rather than rejecting the response.
Groups
Groups nest up to 2 levels deep, counting the root: a root group can hold conditions and groups, and those groups hold only conditions. This is the deepest segment the segment builder can edit.
This selects contacts whose address doesn’t contain @competitor.com and who don’t carry tag 1234.
Conditions
A condition has a field naming what it tests, an op saying how, and usually a value. Which ops, values and filters a field accepts is listed per field in the condition reference.
Any other key is rejected with a 400.
This selects contacts who opened campaign 17795293 (its web_id).
Contacts in scope
The root’s contacts object limits the segment to contacts in particular subscription states, per channel, before any condition applies. Omit it to include every contact on every channel: email, SMS and WhatsApp. When present it must name at least one entry.
Each channel holds lists of entries. A contact is in scope if it matches any entry on any channel.
Also accepted:
"consent": "confirmed"may accompany any entry. It covers the same contacts as the entry without it.email.marketing{"sendable": false, "consent": "unknown"}is the same population asemail.transactional{"sendable": true}.email.transactional{"sendable": false}is valid but covers no contacts.
Rejected with a 400:
"sendable": truewith anyconsentother than"confirmed", or with anyreason.consentandreasonin the same entry."consent": "consented".reasonon SMS or WhatsApp.sms.transactionalandwhatsapp.transactional, which are reserved.
Ids in condition values
Some conditions name another Mailchimp object.
-
Campaigns: use the campaign’s
web_id, the integer returned byGET /3.0/campaigns, not itsid. -
Tags and static segments (
static_segment): use the tag’s or segment’s numericidfromGET /3.0/lists/{list_id}/segments. -
Beta: interest groups, marketing permissions and e-commerce stores. These conditions take Mailchimp’s internal id, which other API endpoints don’t return. To find it:
- Build an advanced segment in Mailchimp that uses the interest, permission or store.
- Read that segment with
GET /3.0/segments/{segment_id}. - Copy the value from its definition.
The format of these conditions may change.
Limits
A definition over either limit is rejected with a 400 that names the limit. Limits apply when you write a definition. A segment built in Mailchimp that exceeds them still reads back normally, but writing that definition back returns a 400.
Errors
Errors use the standard Marketing API error format.
Plan without advanced segmentation. Creating an advanced segment, updating one, or taking a snapshot of one returns HTTP 403 when the account’s plan doesn’t include advanced segmentation:
Invalid definitions return HTTP 400.
-
Structural problems put the reason in
detail, for example an unknown key, a badmatch, a misplacedcontactsor an exceeded limit: -
Condition problems set
detailtosegment conditions failed validation, with oneerrors[]entry per reason, for example an op a field doesn’t support or a value out of range:
Reading a definition back
GET /3.0/segments/{segment_id} returns the definition in the same format, with a few normalizations. Each one selects the same contacts you wrote:
-
contactslists one entry per subscription state. Broad spellings come back as the states they cover. For example,email.marketing [{"sendable": false}]reads back as three entries: unsubscribed, cleaned and transactional-only. A segment created withoutcontactsreads back with every state listed. Writing the response back unchanged stores the same scope. -
A root that mixes conditions with groups reads back with its conditions wrapped in one group of the same
match. The groups stay where they were, beside that wrapper. A root that holds only conditions, or only groups, reads back unchanged.reads back as
-
Empty
extravalues are omitted, andschema_versionis always2.
Condition reference
Fields are grouped by what they test. Each section lists the ops, the value format, the filters, and an example.
Availability, per field:
-
Generally available: works for every audience.
-
Requires …: depends on data or an integration the audience must have, for example a connected store.
-
Beta: works, but its format may change.
Contact data and audience membership
These conditions select contacts by what is stored on their profile: email address, merge fields, language, VIP status, rating, key dates, signup source, tags, groups, subscription status, marketing permissions, age gating and predicted location. None of them take filters. ipgeo is the only one that uses location.
There is no timezone condition. Date conditions are evaluated in a fixed timezone, which each section below names.
merge0 — Email address
Availability: Generally available Compares the contact’s email address with one or more strings.
Example:
Notes:
valueis required for every op exceptblankandblank_not. Each entry is trimmed and must be at most 315 characters.value_opdefaults to"or", so the condition matches if any value matches. Withnotornotcontain,"or"means “differs from at least one value”, which matches almost everyone. Use"value_op": "and"to mean “matches none of these”.- If
isornotis sent with an empty value ("",[]or[""]), it is saved asblankorblank_not.
merge<N> — Merge fields
Availability: Generally available
Compares the contact’s value in one audience merge field. N is the field’s merge_id from GET /3.0/lists/{list_id}/merge-fields, an integer from 1 to 80 (for example merge3). The email address is merge0, documented above.
Mailchimp looks up the merge field’s type, and the type decides which ops and values are allowed. Don’t send a type yourself.
Example:
Notes:
valueis required foris,not,contains,notcontain,starts,ends,date_withinanddate_notwithin. Each entry must be at most 315 characters.- Number fields: every value must be numeric.
- Date fields: send
YYYY-MM-DD, or an ISO date-time with an offset (YYYY-MM-DDThh:mm:ssZ). Day boundaries are evaluated in UTC.isandnotuse only the first value. - Date
date_withinanddate_notwithintake a whole number of days. Tokens like7daysor1monthare rejected, and decimals don’t behave as expected. - Birthday values must be zero-padded (
"06", not"6"). Only the first value is used. - Dropdown and radio button values are the choice labels exactly as defined on the field.
geoinis for fields that hold US ZIP codes.extramust be a 5-digit US ZIP code.value_op("and"or"or", default"or") works as it does formerge0. Use"and"withnotornotcontainto mean “matches none of these”.- An op that isn’t allowed for the field’s type is rejected, with a message listing the ops that are valid.
language — Language
Availability: Generally available The contact’s language preference.
Language codes (case-insensitive): en English, ar Arabic, af Afrikaans, be Belarusian, bg Bulgarian, ca Catalan, zh Chinese (Simplified), zh_CN Chinese (Traditional), hr Croatian, cs Czech, da Danish, nl Dutch, et Estonian, fa Farsi, fi Finnish, fr French (France), fr_CA French (Canada), de German, el Greek, he Hebrew, hi Hindi, hu Hungarian, is Icelandic, id Indonesian, ga Irish, it Italian, ja Japanese, km Khmer, ko Korean, lv Latvian, lt Lithuanian, mt Maltese, ms Malay, mk Macedonian, no Norwegian, pl Polish, pt Portuguese (Brazil), pt_PT Portuguese (Portugal), ro Romanian, ru Russian, sr Serbian, sk Slovak, sl Slovenian, es Spanish (Mexico), es_ES Spanish (Spain), sw Swahili, sv Swedish, ta Tamil, th Thai, tr Turkish, uk Ukrainian, vi Vietnamese, xxxxx Custom.
Example:
Notes:
valueis a single string and is required forisandnot. Arrays are rejected. To match several languages, use a group with"match": "any".
gmonkey — VIP status
Availability: Generally available Whether the contact is marked as a VIP.
Example:
rating — Contact rating
Availability: Generally available The contact’s star rating, from 1 to 5.
Example:
Notes:
valueis required and must be a single integer from 1 to 5, sent as a number or a numeric string.
timestamp_opt, info_changed — Subscription date and Info changed
Availability: Generally available
Both fields take the same ops and values. Dates are evaluated in the account’s timezone.
Example:
Notes:
valueis required for every op.- Use plain
YYYY-MM-DDdates. A date-time is accepted, but its offset is ignored.is,not,greaterandlessuse only the first value. date_withinanddate_notwithintake one whole number of days. Tokens like7daysare rejected.campaign_*ops take theweb_id(an integer) of a sent campaign fromGET /3.0/campaigns, or"last"for the audience’s most recently sent campaign. Check that the campaign exists and has been sent: a bad campaign value may not be rejected when you save, but the segment will fail when it is counted or used.
metadata_created — Contact created date
Availability: Generally available When the contact record was created in the audience, across all channels.
Example:
Notes:
valueis required for every op. Dates areYYYY-MM-DDor an ISO date-time with an offset.- Always send two dates for
between. A single value is read as “within N days”. date_withinanddate_notwithintake a whole number of days.1monthand similar tokens fail.campaign_*values work as they do fortimestamp_opt.
original_signup_source, source — Signup source
Availability: Generally available
How the contact originally joined the audience. value is the source type. The optional extra narrows the match to one specific source of that type, such as a particular import.
Source type ids:
Connected apps can also appear as sources, identified by large integer ids.
Example:
Notes:
valueis required. Send it as a numeric string, for example"10".extrais optional. Omit it, or send"any", to match any source of that type. Otherwise send the id of one specific source, for example an import id for type4or a landing page id for type10. Beta: the specific-source id takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the source, read it withGET /3.0/segments/{segment_id}, and copy the value. The format may change. Withextra,source_ismeans “this exact source” andsource_notmeans “not this exact source”.
static_segment — Tags
Availability: Generally available
Whether the contact has particular tags. Values are tag ids: the integer id of a tag from GET /3.0/lists/{list_id}/tag-search or of a static segment from GET /3.0/lists/{list_id}/segments.
Example:
Notes:
valueis required. Ids are integers, sent as numbers or numeric strings.static_isandstatic_nottake exactly one id. An array is rejected; useis,is_every,notornot_everyfor several tags.
interests-<N> — Groups
Availability: Beta. Takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the group, read it with GET /3.0/segments/{segment_id}, and copy the value. The format may change.
Whether the contact belongs to particular groups (interests). N is the internal id of the group category, and the values are the internal ids of the groups in it. Copy both from a segment built in Mailchimp.
Example:
Notes:
valueis required and must not be empty.- Matching uses only the group ids in
value. Keep the field and the values from the same category, as Mailchimp writes them.
list_email_status — Email subscription status
Availability: Generally available The contact’s email subscription status.
Example:
Notes:
valueis required. Codes are case-insensitive. Other values, such as"subscribed", are rejected.- This condition is combined with the segment’s top-level contact scope. It can narrow that scope, but it can’t add back contacts the scope excludes.
marketing_preference — Marketing permissions
Availability: Beta. Takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the marketing permission, read it with GET /3.0/segments/{segment_id}, and copy the value. The format may change.
Whether the contact has granted a marketing permission (GDPR). Relevant only to audiences with GDPR fields enabled.
Example:
Notes:
valueis required and must be a single numeric id, not the permission’s label.
age_gating — Age gating
Availability: Generally available The contact’s SMS age-verification outcome. Relevant only to audiences with SMS marketing.
Values: "true" means verified, "false" means excluded, and "unknown" means no record.
Example:
Notes:
valueis required forisandnot. Always send an array of strings, not JSON booleans. A bare"unknown"string, not in an array, matches no one."unknown"may be combined with"true"or"false":{"op": "is", "value": ["true", "unknown"]}matches contacts who are verified or have no record, andnotwith the same values matches everyone else.
ipgeo — Predicted location
Availability: Generally available
The contact’s predicted location, estimated from data such as IP address. This is the only condition in this family that uses location.
Example:
Notes:
- The radius is a number of miles. The Mailchimp app offers 25, 50, 75, 100, 150 and 200, but any positive number works.
ipgeoinzipdoesn’t look up the ZIP code. Send the ZIP code’s latitude and longitude inlocation.latandlocation.lng.ipgeocityandipgeonotcitymatch the city name inlocation.cityonly. They are not limited by region or country.location.regionandlocation.country_codeare stored with the segment, but they don’t affect matching.- The negative ops
ipgeonotcountry,ipgeonotstate,ipgeonotcityandipgeonotzipexclude contacts whose location is unknown. To include them, add anipgeounknowncondition in a group with"match": "any".
Email, SMS and WhatsApp engagement and status
These conditions select contacts by what they did with your email, SMS and WhatsApp messages (sends, opens, clicks, replies, bounces, keywords) and by their subscription status, subscription date and phone country on each channel.
Shared filters used by the activity conditions (email_campaign_activity, sms_campaign_activity, whatsapp_campaign_interaction) are described once, in Shared activity filters, at the end of this section.
email_campaign_activity — Email campaign interaction
Availability: Generally available
Selects contacts who did, or did not, receive, open, click, reply to, or bounce from your email campaigns. Filters narrow the match by campaign, time, link, click type, open type and number of events.
With a positive op (sent, open, click, reply, bounce), a contact matches when one activity record satisfies all the filters together. With a no_* op, a contact matches when no activity record satisfies all the filters together. That includes contacts with no activity at all.
Filters (filters is required and must contain at least one filter):
campaign filter
click_url filter
open_type filter (Apple Mail Privacy Protection)
Example:
Opened campaign 17795293 in the last month:
Human clicks on a link containing “/sale” in any of the last 10 campaigns, more than twice:
Notes:
- Campaign ids are the campaign’s
web_idfromGET /3.0/campaigns(an integer), not itsid. A non-numeric value is rejected. - Send one
web_idpercampaignfilter. To match several specific campaigns, use a group with"match": "any". - “Most recently sent” campaigns for
anylastN/alllastNare the list’s sent, non-deleted campaigns that delivered at least one email, newest send time first. A/B test variants are expanded automatically. - Op spellings are
no_sent,no_open,no_click,no_reply. The SMS spellings (nosent,nodelivered) are rejected here. value,value_opandextraare not used on this condition.click_url: every op exceptanyneeds a non-empty string.greaterandlessare rejected.open_typeisornotrequires acampaignfilter. If you combineopen_typeiswithcampaignany, the campaign filter is treated asanylast50. With an “all” campaign op (alllastN) every campaign must satisfy the open type; with any other campaign op, at least one must.open_typeis/notcannot be combined withnumber_eventsis,greaterorless(at_least_onceis allowed).- A filter that belongs to another channel (for example
sms_campaign) is not valid here.
email_marketing_engagement — Email engagement
Availability: Generally available
Selects contacts by how often they engage with your email, based on Mailchimp’s email activity score, or by being newly opted in.
Example:
Notes:
valueis a single lowercase string;"HIGH"is rejected. An array is rejected; to match several levels use a group with"match": "any".filters,value_opandextraare not used.
sms_campaign_activity — SMS interaction
Availability: Requires SMS marketing on the audience
Selects contacts who were, or were not, sent or delivered SMS messages from your SMS campaigns or Customer Journeys, who clicked an SMS tracking link, or who texted a keyword.
With a positive op, a contact matches when one message or click satisfies all the filters together. With a negated op (nosent, nodelivered, no_click), a contact matches when no record satisfies all the filters together, including contacts with no SMS activity.
Filters (filters is required and must contain at least one filter):
Example:
Human clicks in one SMS campaign in the last 30 days:
Texted the keyword “JOIN”:
Notes:
- Beta (
sms_campaignids): Takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the SMS campaign, read it withGET /3.0/segments/{segment_id}, and copy the value. The format may change. - Op spellings:
nosentandnodeliveredhave no underscore;no_clickhas one. The email spellingno_sentis rejected. - There are no
open,replyorbounceops for SMS. For bounces, usesms_bounce_reason. valueis used only byused_keyword(a single string).value_opandextraare not used.- Use only the filters listed above. The email filters
campaign,click_urlandclick_typeare not valid here. - On some accounts
sent,deliveredandclickalso count WhatsApp messages. To target WhatsApp specifically, usewhatsapp_campaign_interaction.
sms_bounce_reason — SMS bounce reason
Availability: Requires SMS marketing on the audience
Selects contacts with at least one SMS campaign or Customer Journey message that bounced, optionally with a specific error code. The error code, campaign and time filters all apply to the same message.
Filters (optional):
Example:
Deactivated or blocklisted number, in the last 30 days:
Notes:
- Codes are not checked against the list above; an unknown code is accepted and matches nobody.
- Every
timeframeop exceptanyneeds a value.betweentakes[start, end], inclusive. campaign_is/campaign_greater/campaign_lesscompare with the send date of an email campaign on the same audience (web_id), or of the audience’s most recently sent email campaign ("last").- Only
sms_campaignandtimeframefilters are accepted. Any other filter is rejected withUnsupported operation: <field>.
sms_contact_status — SMS subscription status
Availability: Requires SMS marketing on the audience
Selects contacts by their SMS marketing subscription status.
Example:
Notes:
- The op is
status_is, notis. - Codes are case-insensitive.
P(pending) and any other code are rejected. An empty array is rejected. filters,value_opandextraare not used.
sms_timestamp_opt — SMS subscription date
Availability: Requires SMS marketing on the audience
Selects contacts by the date their SMS channel was added.
Example:
Notes:
- Dates are
YYYY-MM-DDorYYYY-MM-DDTHH:MM:SS±HH:MM. date_withintakes a number of days."1month"and similar strings are rejected."last"means the audience’s most recently sent email campaign. A campaign without a send date is rejected.- To select dates outside a range, use a group with
"match": "any"that holds alesscondition on the first day and agreatercondition on the last day. Contacts without an SMS subscription date match neither. filters,value_opandextraare not used.
sms_country_code — Mobile phone country
Availability: Requires SMS marketing on the audience
Selects contacts by the country of their SMS phone number. On some accounts it also matches the country of the contact’s WhatsApp number: then in matches if either number is in one of the countries, and not_in matches only if neither number is.
Example:
Notes:
- Send country codes in uppercase.
- Codes are not checked against the countries Mailchimp SMS supports; an unsupported country matches nobody.
- The ops are
in/not_in, notis/not. filters,value_opandextraare not used.
whatsapp_campaign_interaction — WhatsApp interaction
Availability: Requires WhatsApp marketing on the audience
Selects contacts who were, or were not, sent, read, or clicked WhatsApp messages from your campaigns or Customer Journeys. Filters combine the same way as for sms_campaign_activity.
Filters (filters is required and must contain at least one filter):
Example:
Notes:
- Beta (
whatsapp_campaignids): Takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the WhatsApp campaign, read it withGET /3.0/segments/{segment_id}, and copy the value. The format may change. - Op spellings:
nosentandnot_opened(notno_sent/no_open). - There are no
deliveredor keyword ops for WhatsApp. value,value_opandextraare not used.
whatsapp_contact_status — WhatsApp subscription status
Availability: Requires WhatsApp marketing on the audience
Selects contacts by their WhatsApp marketing subscription status.
Example:
Notes:
- Values differ from SMS: use
SUBSCRIBED/UNSUBSCRIBED, notY/N, and the op isis, notstatus_is. Other values are accepted but match nobody. - Send values in uppercase.
notalso matches contacts with no WhatsApp channel.filters,value_opandextraare not used.
whatsapp_timestamp_opt — WhatsApp subscription date
Availability: Requires WhatsApp marketing on the audience
Selects contacts by the date their WhatsApp channel was added.
Example:
Notes:
- Dates are
YYYY-MM-DD. Every op exceptanyneeds a non-empty value. filters,value_opandextraare not used.
Shared activity filters
timeframe
Used by email_campaign_activity, sms_campaign_activity and whatsapp_campaign_interaction. (sms_bounce_reason has its own timeframe op list, above.)
Dates are YYYY-MM-DD, optionally followed by THH:MM[:SS] and a Z or ±HH:MM offset.
number_events
Used by email_campaign_activity (with sent, open, click), sms_campaign_activity (with sent, click) and whatsapp_campaign_interaction (with sent, click). Counts the distinct activity records that match the condition’s other filters.
At most one number_events filter per condition.
Click type filters
click_type (email), sms_click_type (SMS) and whatsapp_click_type (WhatsApp) take op is and one value:
Values must be lowercase as listed. With no_click, all_clicks means “has not clicked at all”. An empty value is treated as contact_clicks for click_type and sms_click_type; whatsapp_click_type requires a value.
E-commerce conditions
E-commerce conditions select contacts by what they did in a connected store: orders and what was in them, lifetime spend and order counts, storefront activity (page views, searches, product and collection views, carts, checkouts), reviews, back-in-stock requests, and predicted churn risk. Unless a section says otherwise, they need a connected e-commerce store. On an audience with no store data, a condition still saves; positive ops match nobody and negative ops match everybody.
Shared values and filters
These rules apply to every condition in this section.
Identifier formats
Text ops. Filters on products, variants, categories, collections, page URLs and search text use the same ops:
Money. Send amounts as a decimal JSON number or numeric string (100, "49.99"), with no currency symbol or thousands separator. Amounts must be zero or greater.
any filters. Every filter accepts "op": "any" with no value, meaning “no restriction”. Leaving the filter out does the same thing and is preferred.
How filters combine. On an activity condition (purchased, viewed, added to cart, and so on), the positive op matches contacts with at least one order or event that meets all the filters at once. The negative op (no_purchased, no_viewed, not_submitted, requested_not, …) matches contacts with no such order or event, including contacts who have no orders or events at all.
ecomm_timeframe filter
Restricts an order or event by when it happened. Dates are evaluated in the account’s timezone. Leave extra out; it is ignored.
- Dates are
YYYY-MM-DD(a time and offset,YYYY-MM-DDTHH:MM:SS+00:00, is also accepted). - On
ecomm,total_spent,spent_avgandorders_count,date_within/date_notwithinalso accept"7days","1month"and"3months"(calendar months). date_within_days,date_within_months,blankandblank_notare not supported here.- A
campaign_*value that doesn’t match a sent campaign in the audience is rejected with HTTP 400.
number_events filter
Counts how many matching orders the contact has. Allowed only under ecomm with purchased; the store event conditions below don’t accept it. At most one per condition.
ecomm — Purchase activity
Availability: Requires a connected e-commerce store.
Contacts who have, or have not, placed an order that meets every filter. With no filters, purchased means “has placed any order”.
Filters
Example:
Notes:
- The activity goes in
op, notvalue.{"field": "ecomm", "op": "is", "value": "purchased"}is rejected. - With
no_purchased, text filters support onlyis,not,containsandnotcontain, andecomm_order_totalsupports onlyisandnot. Don’t combineno_purchasedwithstarts/endsor with order totalgreater/less. - With
no_purchasedand a singleecomm_campaignfilter, orders with no attributed campaign count as “not from that campaign”. ecomm_price,ecomm_quantity,ecomm_page_url,ecomm_searchand review filters aren’t accepted here.
total_spent — Amount spent in total
Availability: Requires a connected e-commerce store. Scoping filters are Beta (see below). Contacts by the sum of their order totals. Without scoping filters this is the contact’s lifetime total.
Two shapes are accepted.
Simple shape: the comparison is on the condition.
Filtered shape: op is is or not (not excludes the contacts the filters describe), with no value. The comparison goes in a filter.
Filters (filtered shape only)
Example:
Notes:
- Scoping filters (
ecomm_timeframe,ecomm_store,ecomm_collection) aren’t available on every account yet. Where they aren’t available, the segment saves, but requests for its count or members return an error. - With scoping filters,
isandnotcompare to the cent. - Other filters (for example
ecomm_product) are ignored. Don’t send them. "$250"is rejected; send"250".
spent_avg — Average amount spent per order
Availability: Requires a connected e-commerce store. Scoping filters are Beta.
Contacts by their average order value. Same two shapes as total_spent.
Filtered shape: op is / not, no value.
Filters (filtered shape only)
Example:
Notes:
- To match zero, send
0(not0.00). - The scoping-filter rollout note on
total_spentapplies here too. - Only
greater,less,isandnotare accepted;betweenis rejected.
orders_count — Total number of orders
Availability: Requires a connected e-commerce store. Scoping filters are Beta.
Contacts by how many orders they’ve placed. Same two shapes as total_spent.
Filtered shape: op is / not, no value.
Filters (filtered shape only)
Example:
Notes:
- Counts must be whole numbers:
2.5and5.0are rejected. ecomm_collectionisn’t supported on a count of orders and is rejected.- The scoping-filter rollout note on
total_spentapplies here too.
ecomm_page_viewed — Page viewed
Availability: Requires a connected e-commerce store. Contacts who did, or didn’t, view a storefront page that meets every filter.
Filters
Example:
Notes:
- The op is
page_viewed, notviewed.
ecomm_product_viewed — Product viewed
Availability: Requires a connected e-commerce store. Contacts who did, or didn’t, view a product that meets every filter.
Filters
Example:
Notes:
- There are no price, quantity or total filters on this condition.
ecomm_collection_viewed — Collection viewed
Availability: Requires a connected e-commerce store. Contacts who did, or didn’t, view a collection page that meets every filter.
Filters
Example:
Notes:
- Product, variant and category filters aren’t accepted here.
ecomm_search_submitted — Search submitted
Availability: Requires a connected e-commerce store. Contacts who did, or didn’t, run a storefront search that meets every filter.
Filters
Example:
Notes:
- The op is
searched, notsearch_submitted.
ecomm_product_added_to_cart — Product added to cart
Availability: Requires a connected e-commerce store. Contacts who did, or didn’t, add a product to their cart that meets every filter.
Filters
Example:
Notes:
ecomm_order_totalisn’t accepted here; useecomm_price.
ecomm_checkout_started — Checkout started
Availability: Requires a connected e-commerce store.
Contacts who did, or didn’t, start a checkout that meets every filter. Use no_checkout_started together with purchase activity to find abandoned checkouts.
Filters
Example:
ecomm_review_submitted — Review submitted
Availability: Requires a connected Judge.me or Yotpo reviews integration. Contacts who did, or didn’t, submit a store or product review that meets every filter.
Filters
Example:
Notes:
{"field": "ecomm_review_type", "op": "is", "value": "product_review"}is rejected; put the type inop.number_eventsisn’t supported on this condition.
ecomm_back_in_stock_request — Back in stock request
Availability: Requires back-in-stock requests collected through Mailchimp signup forms. Contacts who did, or didn’t, ask to be notified when a product is back in stock.
Filters
Example:
Notes:
- This condition uses its own filter ids.
ecomm_store,ecomm_product,ecomm_timeframeandnumber_eventsare rejected. - Leave out a filter you don’t need rather than sending it with
any.
Churn risk and the legacy customer lifetime value predictions are documented under Predictive insights and integrations.
Predictive insights and integrations
These conditions select contacts by predictions Mailchimp computes from purchase and profile data (purchase likelihood, lifetime value, next order date, churn risk, age and gender), and by activity synced in from connected integrations (lead ads, bookings and QuickBooks Online). Predicted location (ipgeo) and age gating (age_gating) are documented with the contact data conditions.
Prediction freshness (applies to the first four conditions)
predicted_clv, likelihood_to_purchase, time_to_next_purchase and ecomm_churn_risk only consider contacts whose prediction was refreshed in the last 60 days (UTC). A contact whose latest prediction is older than that never matches, whatever the op. You can’t change this window.
predicted_clv — Predicted customer lifetime value
Availability: Requires predictive insights (a connected e-commerce store with enough purchase history).
Selects contacts whose predicted customer lifetime value is above or below an amount in US dollars.
Example:
Notes:
valuemust be a number 0 or greater, in US dollars. A JSON number or a numeric string ("250") both work.- Any other op (for example
is) is rejected withOperation must be one of 'any', 'greater', 'less'.
likelihood_to_purchase — Likelihood to purchase
Availability: Requires predictive insights (a connected e-commerce store with enough purchase history).
Selects contacts by a predicted purchase-likelihood score. A higher score means the contact is more likely to purchase.
Example:
Notes:
valuemust be an integer from 0 to 1000.- The value is a score, not a label:
"high"or"low"aren’t valid. Any op other than the three above is rejected withOperation must be one of 'greater', 'less', 'any'. - Not the same as
clv_lifecycle(the legacy “likelihood to purchase again” condition).
time_to_next_purchase — Predicted next order date
Availability: Requires predictive insights (a connected e-commerce store with enough purchase history).
Selects contacts by the date Mailchimp predicts they’ll place their next order.
Examples:
Notes:
- Dates and “today” are evaluated in UTC.
date_withinhas no lower bound, so it also matches contacts whose predicted date has already passed. To match only upcoming dates, usebetweenwith today’s date as the start.- Dates must be
YYYY-MM-DD. Any other format fails withInvalid date format: <value>.betweentakes exactly two dates. - A non-integer day count fails with
Value must be a valid number for 'within' and 'notwithin' operators, and a count of 0 or less fails withValue must be greater than 0 for 'within' and 'notwithin' operators. - Any other op fails with
Operation must be any, between, greater, less, date_within, or date_notwithin.
ecomm_churn_risk — Customer churn risk
Availability: Requires predictive insights (a connected e-commerce store with enough purchase history).
Selects contacts by their predicted churn-risk level.
Example:
Notes:
- Values must be uppercase;
"high"is rejected. valueis a single string. Arrays are rejected withChurn risk must be one of LOW, MEDIUM, HIGH. To match two levels, put two conditions in a"match": "any"group.- Use
notfor “is not”.is_notandnoneare rejected.
clv_lifetime_value — Customer lifetime value (legacy)
Availability: Beta. Requires a connected e-commerce store with customer lifetime value predictions.
Selects contacts whose lifetime-value level for one e-commerce store is, or is not, a given level. This is the older store-level prediction. For a dollar amount, use predicted_clv.
extra (required): the e-commerce store id, as a string. Takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the e-commerce store, read it with GET /3.0/segments/{segment_id}, and copy the value. The format may change.
Example:
Notes:
- Send values in lowercase.
moderateandmediumare not valid; useaverage. - A missing
extrais rejected with a 400. An empty string is accepted but matches nobody.
clv_lifecycle — Likelihood to purchase again (legacy)
Availability: Beta. Requires a connected e-commerce store with customer lifetime value predictions.
Selects contacts whose repeat-purchase likelihood level for one e-commerce store is, or is not, a given level. For a numeric score, use likelihood_to_purchase.
extra (required): the e-commerce store id, as a string. Takes Mailchimp’s internal id, which other API endpoints don’t return. To find it, build an advanced segment in Mailchimp that uses the e-commerce store, read it with GET /3.0/segments/{segment_id}, and copy the value. The format may change.
Example:
Notes:
- Send values in lowercase.
high,moderateandloware not valid values for this field and are rejected with a 400. - A missing
extrais rejected with a 400.
age_range — Predicted age range
Availability: Requires predicted demographics to be turned on for the account.
Selects contacts by their predicted age bracket.
Example:
Notes:
valuemust be one of18-24,25-34,35-44,45-54,55-64,65+, as a single string. Other strings are accepted but match nobody, so check the spelling.isornotwithout a value is rejected with a 400.
gender — Predicted gender
Availability: Requires predicted demographics to be turned on for the account.
Selects contacts by their predicted gender.
Examples:
Notes:
- Values are case-insensitive.
otheris shown as “Another identity” in Mailchimp;another_identityis not a valid value. blankmeans the prediction isunknown, not that the contact has no prediction. Contacts that were never scored don’t matchblank.- With
blankandblank_not, send"value": "".
lead_ad — Lead ad activity
Availability: Requires a connected lead ads integration.
Selects contacts who did (is) or did not (not) come in through a lead ad matching the filters.
Filters (all optional; a contact matches when a single lead ad response satisfies every filter):
lead_ad_timeframe values:
is,not,greater,less: a date,"YYYY-MM-DD".between:["YYYY-MM-DD", "YYYY-MM-DD"].date_within,date_notwithin: an integer number of days back from today.campaign_is,campaign_greater,campaign_less: on, after or before the send date of a campaign. The value is the campaign’sweb_idfromGET /3.0/campaigns(an integer), or"last"for the most recent campaign sent to this audience.
Example:
Notes:
contains,notcontain,startsandendsonform_nameandintegration_nameare case-insensitive.anyon a filter is not a no-op: it requires the response to have a value for that attribute. To leave an attribute unconstrained, omit the filter.lead_ad_timeframedates are evaluated in the account’s timezone. Anyextrayou send on it is replaced.- A campaign op fails with
No valid campaigns foundif the campaign hasn’t been sent to this audience. - The filter is
lead_ad_timeframe, nottimeframe. Unknown filter fields fail withUnsupported operation: <field>.
booking_activity — Booking activity
Availability: Requires a connected booking integration that syncs bookings to Mailchimp.
Selects contacts who have (or have no) booking matching the filters.
Filters (all optional; a single booking must satisfy every filter):
Examples:
Notes:
booking_service_typevalues must be uppercase and a single string;"appointment"is rejected.anyonbooking_service_type,booking_service_nameorbooking_service_categoryrequires the booking to have a value for that attribute. To leave it unconstrained, omit the filter.- Campaign ops take the campaign’s
web_idfromGET /3.0/campaigns(an integer), or"last". no_booking_activityneeds at least one filter; without one it is rejected.- Any other top-level op fails with
Operation must be booking_activity or no_booking_activity.
qbo_invoice_activity — QuickBooks Online invoice activity
Availability: Requires the QuickBooks Online integration, with contact sync turned on for the audience.
Selects contacts who have (or don’t have) a QuickBooks Online invoice matching the filters.
Filters (all optional; a single invoice must satisfy every filter):
Examples:
Notes:
- Always send
qbo_payment_statusas an array, even for one status. Status values are lowercase. overduemay be combined with other statuses in one filter, for example["paid", "overdue"]; the condition matches invoices in any of them.- An unknown status is rejected with a 400 that lists the valid statuses.
- Campaign ops take the campaign’s
web_idfromGET /3.0/campaigns(an integer), or"last". - Any other top-level op fails with
Operation must be qbo_has_invoice or qbo_no_invoice.
qbo_sales_receipt_activity — QuickBooks Online sales receipt activity
Availability: Requires the QuickBooks Online integration, with contact sync turned on for the audience.
Selects contacts who have (or haven’t) purchased through a QuickBooks Online sales receipt matching the filters.
Filters (all optional; a single sales receipt must satisfy every filter): qbo_timeframe, qbo_product and qbo_order_total, with the same ops and values as on qbo_invoice_activity, applied to the sales receipt. qbo_payment_status isn’t available here.
Example:
Notes:
- The ops differ from invoices:
qbo_has_invoiceis rejected here withOperator must be qbo_purchased or qbo_notpurchased.
Events
Event conditions select contacts by the events recorded for them: contact events you post to a member with the Events API (contact_event), and custom events that have a namespace, an event name and typed properties (custom_event_*). This section also covers number_events, the filter that turns “did this at least once” into “did this exactly, more than, or fewer than N times” on activity conditions.
contact_event — Custom engagement
Availability: Generally available
Selects contacts who have, or have not, had at least one contact event that matches all of the condition’s filters. Contact events are the events you post with POST /3.0/lists/{list_id}/members/{subscriber_hash}/events. Every filter must match the same event: name, time and properties are checked together on one event, not across several.
Filters
You can include a filter field more than once. For example, two contact_event_property filters require one event to have both key/value pairs.
contact_event_timeframe ops:
contact_event_property ops (value is always the key, matched exactly):
Example: contacts who had a signed_up event on the pricing page in the last 30 days.
Example: contacts who had no trial_started event during 2025.
Notes:
- Put the property value in
extra, not invalue.{"field": "contact_event_property", "op": "is", "value": "plan=gold"}is rejected becauseextrais missing. Write"value": "plan", "extra": "gold"instead. - To find contacts who never had an event, use
"op": "not"on thecontact_eventcondition withcontact_event_nameis. Puttingnotoncontact_event_namewith"op": "is"on the condition selects contacts who had some other event. - Dates must be
YYYY-MM-DDorYYYY-MM-DDTHH:MM:SS±HH:MM. Any other format is rejected. Dates are interpreted in UTC. betweenneeds exactly two dates.- Don’t send
value,value_oporextraon thecontact_eventcondition itself. contact_event_name,contact_event_timeframeandcontact_event_propertywork only as filters ofcontact_event. Used as a top-levelfield, they are rejected.number_eventsis not supported oncontact_event.
custom_event_* — Custom event
Availability: Requires custom events in the audience
Selects contacts who have, or have not, had at least one custom event with a given namespace and event name. Property filters can narrow the match by the event’s typed properties. The namespace, the event name and every property filter must match the same event.
- Namespace: the group the event belongs to, usually the integration or system that sends it (for example
loyalty). - Event name: the event type within that namespace (for example
rewards-redeemed).
Field id: custom_event_ + the namespace in lowercase with spaces replaced by - + _ + the event name. For namespace Loyalty and event rewards-redeemed, the field id is custom_event_loyalty_rewards-redeemed. Mailchimp uses the field id to look up the event’s property schema. The event to match is the one named by namespace and event_name.
Condition keys
Filters
Property filter types and ops:
greater and less are strict (greater than / less than). any means no restriction on that property.
Example: contacts who redeemed a loyalty reward worth more than 500 points.
Example: contacts who have never redeemed a loyalty reward, using the identity filters instead of the condition keys.
Notes:
- Always identify the event. Either set
namespaceandevent_nameon the condition (the canonical form, which is how segments are read back), or add both thecustom_event_namespaceandcustom_event_namefilters. Use one form, not both. - A property filter without
type, or with atypeother than the five listed, is rejected. - Property values must also meet the constraints in the event’s schema, such as allowed values, minimum and maximum, and length or pattern.
- Custom events have no separate timeframe filter. To filter by time, use a
datetimeproperty. number_eventsis not supported on custom events.- Don’t send
value,value_oporextraon the condition itself.
number_events — Number of times (filter)
Availability: Generally available
A filter, not a top-level condition. Add it to the filters of a supported activity condition to require that the contact performed the activity exactly, more than, or fewer than N times. Without it, those conditions mean “at least once”.
Supported parent conditions:
Example: contacts who purchased exactly twice.
Example: contacts who opened emails at least 5 times (written as more than 4).
Notes:
valuemust be a single integer from 1 to 10. Arrays, decimals, and numbers outside that range are rejected. For “at least N”, usegreaterwith N − 1.- Use at most one
number_eventsfilter per condition. A segment can still contain several conditions that each have their ownnumber_events. number_eventsis rejected on negative parent ops (for exampleno_open,no_purchased,no_page_viewed,no_viewed), onemail_campaign_activityopreply, and onsms_campaign_activityopsdeliveredandused_keyword.- On
email_campaign_activitywith opopen, you can’t combine a countingnumber_events(is,greaterorless) with anopen_typefilter other thanany. number_eventsis not supported oncontact_eventorcustom_event_*, and it is rejected as a top-levelfield.- The count is the number of times the contact performed the activity.