Skip to navigation

Alternative schemas

The basics

The Mailchimp Marketing API has several endpoints that are capable of accepting or returning multiple types of data. The API specifies alternative schemas for these endpoints, with additional parameters for requesting a particular type of data.

This documentation covers the Marketing API’s implementation of alternative schemas, including tables of the supported alternative schemas and their parameters. For further details on other aspects of these endpoints, consult the full API reference.

Structure

To specify alternate schemas, the Marketing API uses x-oneOf, a variation on the Open API Specification’s oneOf keyword. The value of x-oneOf is an array of objects, each representing a possible schema for the endpoint.

To choose among alternative schemas, you need to know the name of the schema and the field where you provide that name. The name of each schema is the x-value inside the schema object. The field name for a particular endpoint is specified as the propertyName of its x-discriminator object. Your code should be able to handle any type of data based on its x-value, or you should limit your API calls to the data types you want to handle.

For example, say you want to add a segment using a conditions parameter to determine who is included in the segment. This parameter’s specification indicates that it uses alternative schemas with the x-discriminator named condition_type. Find the x-value of the type of segment you want to create and pass that within conditions.

For some endpoints, specifying a particular schema affects not only the type of data returned, but also the other values you can pass in your request. Operators for comparing data are given in the op field, and valid comparisons are given in the value field.

Activity schemas

The Member Activity Feed endpoint can return a range of activity types. Although the x-discriminator for these activity schemas is activity_type, the relevant request parameter is activity_filters, which accepts an array of x-values instead of a single string. If you pass activity_filters, activity matching one of the provided types will be returned; if you omit it, any type of activity that matches your query will be returned.

Email Opens — Activity feed item representing opening an email.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
campaign_idstringThe campaign’s unique id.
campaign_titlestringThe title of the campaign.

Email Clicks — Activity feed item representing having a link clicked by a contact.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
campaign_idstringThe campaign’s unique id.
campaign_titlestringThe title of the campaign.
link_clickedstringThe URL of the link that was clicked.

Email Bounced — Activity feed item representing an email to this contact bouncing.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
campaign_idstringThe campaign’s unique id.
campaign_titlestringThe title of the campaign.
bounce_typestring enumThe type of bounce.
bounce_has_open_activitybooleanIndicates if the email associated with this bounce also has open activity on the same campaign.

List Unsubscribed — Activity feed item representing this contact unsubscribing from a list.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
campaign_idstringThe campaign’s unique id.
campaign_titlestringThe title of the campaign.
is_admin_unsubscribedbooleanIndicates if an admin unsubscribed a contact.
unsubscribe_reasonstringIndicates the reason that the contact was unsubscribed.

Email Sent — Activity feed item representing having an email sent to the contact.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
campaign_idstringThe campaign’s unique id.
campaign_titlestringThe title of the campaign.

Email Conversation — Activity feed item representing an individual reply in a conversation.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
campaign_idstringThe campaign’s unique id.
campaign_titlestringThe title of the campaign.
thread_idstringThe thread’s unique id of the conversation referenced in this event.
message_textstringThe body of the message in this conversation.
created_bystringThe username of the person who created this event.
is_userbooleanIndicates that the message created by a user (as opposed to a contact).
has_readbooleanIndicates that the message has been read.
from_emailstringThe email of the contact who sent the reply.
avatar_urlstringThe gravatar URL of the contact who sent the reply.

Note — Activity feed item representing a note on the contact record.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
updated_at_timestampstring (date-time)The updated at timestamp in ISO8601.
note_idstringThe note’s unique id.
note_textstringThe note’s text.
created_bystringThe person who created the note.
avatar_urlstringThe URL of the contact’s profile gravatar image.

Marketing Permission — Activity feed item indicating if a marketing permission was added or updated.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
marketing_permisson_textstringThe text describing this marketing permission.
updated_bystringThe name of the contact who updated this permission.
marketing_permission_opted_inbooleanIndicates if the marketing permission is enabled or not.

Postcard Sent — Activity feed item representing a time when a contact was sent a particular postcard.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
outreach_idstringThe outreach’s unique id.
outreach_titlestringThe title of the outreach.

Squatter Signup — Activity feed item to representing a contact signing up for the audience from a squatter page.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
outreach_idstringThe outreach’s unique id.
outreach_titlestringThe title of the outreach.

Website Signup — Activity feed item to representing a contact signing up for the contact through a website page.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
outreach_idstringThe outreach’s unique id.
outreach_titlestringThe title of the outreach.

Landing Page Signup — Activity feed item to representing a contact signing up for the list via a landing page.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
outreach_idstringThe outreach’s unique id.
outreach_titlestringThe title of the outreach.

Ecommerce Signup — Activity feed item to representing a contact signing up for the list via a ecommerce store.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
store_namestringThe name of the store.

Generic Signup — Activity feed item that represents a contact signing up for the audience via a generic some generic method (specifically, one we can’t link to).

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
signup_categorystringHow was this user added to the list.

Ecommerce Order — Activity feed item that represents an order.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
outreach_idstringThe outreach’s unique id.
outreach_typestringThe type of outreach that triggered the event.
outreach_titlestringThe title of the outreach.
order_idstringThe unique order id.
order_totalstringThe order total formatted as a string.
order_itemsarrayAn array of items that have been ordered.
store_namestringThe name of the store for an order.
order_urlstringThe order URL.

Contact Activity Event — Activity feed item that represents a generic event.

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
event_namestringThe name of the event.
event_propertiesarrayAn arbitrary datastore containing properties for the given event.

Survey response — Represents when a contact completes and submits a survey

PropertyTypeDescription
activity_typestring enumThe type of event activity.
created_at_timestampstring (date-time)The created at timestamp in ISO8601.
survey_idstringThe survey’s unique id.
survey_titlestringThe title of the survey.

Segment condition schemas

A variety of endpoints accept or return segment condition data, from the Segments endpoints themselves to others like automation, list, and campaign endpoints. Because there are many ways to define a segment, there are many alternative schemas for segment conditions. 

The x-discriminator for segment conditions is condition_type. The request parameter conditions accepts an array of objects that indicate the desired segment condition (field), operator, value, and optional extra information. Multiple segment conditions can be combined like so:

{
"name": "Gmail users who subscribed in 2021 or later",
"options": {
"match": "all",
"conditions": [
{
"field": "timestamp_opt",
"op": "greater",
"value": "date",
"extra": "2021-01-01"
},
{
"field": "EMAIL",
"op": "contains",
"value": "gmail.com"
}
]
}
}

Aim Segment — Segment by interaction with a specific campaign.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by interaction with a specific campaign.
opstring enumThe status of the member with regard to their campaign interaction. One of the following: opened, clicked, was sent, didn’t open, didn’t click, or was not sent.
valuestringEither the web id value for a specific campaign or ‘any’ to account for subscribers who have/have not interacted with any campaigns.

Automation Segment — Segment by interaction with an Automation workflow.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by interaction with an Automation workflow.
opstring enumThe status of the member with regard to the automation workflow. One of the following: has started the workflow, has completed the workflow, has not started the workflow, or has not completed the workflow.
valuestringThe web id for the automation workflow to segment against.

Poll Activity Segment — Segment by poll activity.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by poll activity.
opstring enumMembers have/have not interacted with a specific poll in a Mailchimp email.
valuenumberThe id for the poll.

Conversation Segment — Segment by interaction with a campaign via Conversations.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by interaction with a campaign via Conversations.
opstring enumThe status of a member’s interaction with a conversation. One of the following: has replied or has not replied.
valuestringThe web id value for a specific campaign or ‘any’ to account for subscribers who have/have not interacted with any campaigns.

Date Segment — Segment by a specific date field.

PropertyTypeDescription
condition_typestring enum
fieldstring enumThe type of date field to segment on: The opt-in time for a signup, the date the subscriber was last updated, or the date of their last ecomm purchase.
opstring enumWhen the event took place: Before, after, is a specific date, is not a specific date, is blank, or is not blank.
valuestringWhat type of data to segment on: a specific date, a specific campaign, or the last campaign sent.
extrastringWhen segmenting on ‘date’ or ‘campaign’, the date for the segment formatted as YYYY-MM-DD or the web id for the campaign.

Email Client Segment — Segment by use of a particular email client.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by use of a particular email client.
opstring enumWhether to match email clients that do or do not match the value.
valuestringThe name of the email client.

Language Segment — Segment by language.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by language.
opstring enumWhether the member’s language is or is not set to a specific language.
valuestringA two-letter language identifier.

Member Rating Segment — Segment by member rating.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by member rating.
opstring enumMembers who have have a rating that is/not exactly a given number or members who have a rating greater/less than a given number.
valuenumberThe star rating number to segment against.

Signup Source Segment — Segment by signup source.

PropertyTypeDescription
condition_typestring enum
fieldstring enum
opstring enumWhether the member’s signup source was/was not a particular value.
valuestringThe signup source.

SurveyMonkey Segment — Segment by interaction with a SurveyMonkey survey.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by interaction with a SurveyMonkey survey.
opstring enumThe status of the member with regard to the survey.One of the following: has started the survey, has completed the survey, has not started the survey, or has not completed the survey.
valuestringThe unique ID of the survey monkey survey.

VIP Segment — Segment by VIP status.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting based off of a subscriber’s VIP status.
opstring enumWhether the member is or is not marked as VIP.

Interests Segment — Segment by an interest group merge field.

PropertyTypeDescription
condition_typestring enum
fieldstringSegmenting based on interest group information. This should start with ‘interests-’ followed by the grouping id. Ex. ‘interests-123’.
opstring enumWhether the member is a part of one, all, or none of the groups.
valuearrayAn array containing strings, each representing a group id.

Ecommerce Category Segment — Segment by purchases in specific items or categories.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by purchases in specific items or categories.
opstring enumA member who has purchased from a category/specific item that is/is not a specific name, where the category/item name contains/doesn’t contain a specific phrase or string, or a category/item name that starts/ends with a string.
valuestringThe ecommerce category/item information.

Ecommerce Number Segment — Segment by average spent total, number of orders, total number of products purchased, or average number of products per order.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by average spent total, number of orders, total number of products purchased, or average number of products per order.
opstring enumMembers who have spent exactly, have not spent exactly, spent more, or spent less than the segment value.
valuenumberMembers who have spent exactly, have not spent exactly, spent more, or spent less than this amount.

Ecommerce Purchased Segment — Segment by whether someone has purchased anything.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by whether someone has purchased anything.
opstring enumMembers who have have (‘member’) or have not (‘notmember’) purchased.

Ecommerce Spent Segment — Segment by amount spent on a single order or across all orders.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by amount spent on a single order or across all orders.
opstring enumMembers who have spent ‘more’ or ‘less’ than then specified value.
valueintegerThe total amount a member spent.

Ecommerce Purchased Store Segment — Segment by purchases from a specific store.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by purchases from a specific store.
opstring enumMembers who have or have not purchased from a specific store.
valuestringThe store id to segment against.

Goal Activity Segment — Segment by Goal activity.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by Goal activity.
opstring enumWhether the website URL is/not exactly, contains/doesn’t contain, starts with/ends with a string.
valuestringThe URL to check Goal activity against.

Goal Timestamp Segment — Segment by most recent interaction with a website.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by most recent interaction with a website.
opstring enumWhether the website activity happened after, before, or at a given timestamp.
valuestringThe date to check Goal activity against.

Similar Subscribers Segment Member Segment — Segment by similar subscribers.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by similar subscribers.
opstring enumMembers who are/are not apart of a ‘similar subscribers’ segment.
valuenumberThe id for the ‘similar subscribers’ segment.

Static Segment Member Segment — Segment by a given static segment.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by a given static segment.
opstring enumMembers who are/are not apart of a static segment.
valuenumberThe id for the static segment.

Location-Based Segment — Segment by a specific country or US state.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting subscribers who are within a specific location.
opstring enumSegment members who are within a specific country or US state.
valuestringThe two-letter country code or US state abbreviation.

Geolocation Segment — Segment by a specific geographic region.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting subscribers who are within a specific location.
opstring enumSegment members who are within a specific geographic region.
valueintegerThe radius of the target location.
addrstringThe address of the target location.
latstringThe latitude of the target location.
lngstringThe longitude of the target location.

US ZIP Code Segment — Segment by a specific US ZIP code.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting subscribers who are within a specific location.
opstring enumSegment members who are within a specific US ZIP code.
valueintegerThe radius of the target location.
extraintegerThe zip code to segment against.

Unknown Location-Based Segment — Segment members whose location information is unknown.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting subscribers who are within a specific location.
opstring enumSegment members for which location information is unknown.

Zip Code Location-Based Segment — Segment by a specific US ZIP code.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting subscribers who are within a specific location.
opstring enumSegment members who are/are not within a specific US zip code.
valueintegerThe 5-digit zip code.

Social Profiles Age Segment — Segment by age ranges in Social Profiles data.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by age ranges in Social Profiles data.
opstring enumMembers who are/not the exact criteria listed.
valuestring enumThe age range to segment.

Social Profiles Gender Segment — Segment by listed gender in Social Profiles data.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by listed gender in Social Profiles data.
opstring enumMembers who are/not the exact criteria listed.
valuestring enumThe Social Profiles gender to segment.

Social Profiles Influence Segment — Segment by influence rating in Social Profiles data.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by influence rating in Social Profiles data.
opstring enumMembers who have a rating that is/not or greater/less than the rating provided.
valuenumberThe Social Profiles influence rating to segment.

Social Profiles Social Network Segment — Segment by social network in Social Profiles data.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by social network in Social Profiles data.
opstring enumMembers who are/not on a given social network.
valuestring enumThe social network to segment against.

Social Profiles Social Network Follow Segment — Segment by social network in Social Profiles data.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by social network in Social Profiles data.
opstring enumMembers who are/not following a linked account on a given social network.
valuestring enumThe social network to segment against.

Address Merge Field Segment — Segment by an address-type merge field.

PropertyTypeDescription
condition_typestring enum
fieldstringAn address-type merge field to segment.
opstring enumWhether the member’s address merge field contains/does not contain a value or is/is not blank.
valuestringThe value to segment a text merge field with.

Address/Zip Merge Field Segment — Segment by an address-type merge field within a given distance.

PropertyTypeDescription
condition_typestring enum
fieldstringAn address or zip-type merge field to segment.
opstring enumWhether the member’s address merge field is within a given distance from a city or zip.
valuestringThe distance from the city/zip.
extrastringThe city or the zip being used to segment against.

Birthday Merge Field Segment — Segment by a contact’s birthday.

PropertyTypeDescription
condition_typestring enum
fieldstringA date merge field to segment.
opstring enumWhether the member’s birthday merge information is/is not a certain date or is/is not blank.
valuestringA date to segment against (mm/dd).

Date Merge Field Segment — Segment by a given date merge field.

PropertyTypeDescription
condition_typestring enum
fieldstringA date merge field to segment.
opstring enumWhether the member’s merge information is/is not, is greater/less than a value or is/is not blank.
valuestringA date to segment against.

Dropdown/Radio Merge Field Segment — Segment by a given dropdown or radio button merge field.

PropertyTypeDescription
condition_typestring enum
fieldstringA merge field to segment.
opstring enumWhether the member’s merge information is/is not a value or is/is not blank.
valuestringThe value to segment a text merge field with.

Text or Number Merge Field Segment — Segment by a given text or number merge field.

PropertyTypeDescription
condition_typestring enum
fieldstringA text or number merge field to segment.
opstring enumWhether the member’s merge information is/is not, contains/does not contain, starts/ends with, or is greater/less than a value
valuestringThe value to segment a text or number merge field with.

Email Segment — Segment by email address.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegmenting based off of a subscriber’s email address.
opstring enumWhether the email address is/not exactly, contains/doesn’t contain, starts/ends with a string.
valuestringThe value to compare the email against.

Predicted Gender Segment — Segment by predicted gender.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by predicted gender.
opstring enumMembers who are/not the exact criteria listed.
valuestring enumThe predicted gender to segment.

Predicted Age Segment — Segment by predicted age.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by predicted age.
opstring enumMembers who are/not the exact criteria listed.
valuestring enumThe predicted age to segment.

New Subscribers Prebuilt Segment — Segment by when people subscribed.

PropertyTypeDescription
condition_typestring enum
fieldstring enumSegment by when people subscribed.
opstring enumWhe the event took place, namely within a time frame.
valuestringWhat type of data to segment on: a specific date, a specific campaign, or the last campaign sent.