MailChimp API v1.2 Documentation

Submit URL & Parameters

Important: Our API endpoints (or submit URLs) are datacenter specific. If a datacenter prefix is not used, then "us1" is assumed. Some API Wrappers have been updated to auto-switch based on API Keys. If you are not using a wrapper, you will need to hard code the endpoint into your app.

For XML-RPC, simply tell your client to connect to:

http://<dc>.api.mailchimp.com/1.2/

For Serialized JSON, use:

http://<dc>.api.mailchimp.com/1.2/?output=json&method=SOME-METHOD&[other parameters]

For Serialized XML, use:

http://<dc>.api.mailchimp.com/1.2/?output=xml&method=SOME-METHOD&[other parameters]

For Serialized PHP, use:

http://<dc>.api.mailchimp.com/1.2/?output=php&method=SOME-METHOD&[other parameters]

For Serialized LOLCODE, use:

http://<dc>.api.mailchimp.com/1.2/?output=lolcode&method=SOME-METHOD&[other parameters]

Note that for the Serialized versions, method is the method from our API you are calling and [other parameters] are the parameters the documentation calls for. Additionally, either GET or POST requests may be used for the serialized versions, though the method currently must always be a GET parameter.

HTTPS / Secure Connections

HTTPS is 100% supported with valid, signed certificates for all API methods regardless of whether your calls use XML-RPC or the Serialized GET/POST. Those manually coding Submit URLs can simply change the http to https in the URL (make sure your connection library supports HTTPS!). Some API Wrappers have switches to turn HTTPS on - others may require hacking at their source or contacting the author to include support.

Noteworthy Quriks

Throughout this API, a return value of an empty object "{}" will be represented by an empty array "[]". We recognize the headache this causes to our friends in statically-typed languages, but changing the behavior would be backwards incompatible for versions up to 2.0. This problem will be resolved in the next version after 2.0

Questions? Problems?

Have you run into difficulties or a method just doesn't seem to work right? Check out our API Support options here and we'll be happy to assist you.

Method & Error code docs


Error Codes

exceptions

A mapping of known Exception classes to numerical codes that will be returned when errors occur.

 
Method Categories
Campaign Related
Campaign Stats
Campaign AIM
Helper
List Related
Security Related

Campaign Related Methods  

campaignContent(string apikey, string cid, bool for_archive)

Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content

campaignCreate(string apikey, string type, array options, array content, array segment_opts, array type_opts)

Create a new draft campaign to send.

campaignDelete(string apikey, string cid)

Delete a campaign.

campaignEcommAddOrder(string apikey, array order)

Attach Ecommerce Order Information to a Campaign.

campaignFolders(string apikey)

List all the folders for a user account

campaignPause(string apikey, string cid)

Pause an AutoResponder orRSS campaign from sending

campaignReplicate(string apikey, string cid)

Replicate a campaign.

campaignResume(string apikey, string cid)

Resume sending an AutoResponder or RSS campaign

campaignSchedule(string apikey, string cid, string schedule_time, string schedule_time_b)

Schedule a campaign to be sent in the future

campaignSegmentTest(string apikey, string list_id, array options)

Allows one to test their segmentation rules before creating a campaign using them

campaignSendNow(string apikey, string cid)

Send a given campaign immediately.

campaignSendTest(string apikey, string cid, array test_emails, string send_type)

Send a test of this campaign to the provided email address

campaignShareReport(string apikey, string cid, array opts)

Get the URL to a customized VIP Report for the specified campaign and optionally send an email to someone with links to it.

campaignTemplates(string apikey)

Retrieve all templates defined for your user account

campaignUnschedule(string apikey, string cid)

Unschedule a campaign that is scheduled to be sent in the future

campaignUpdate(string apikey, string cid, string name, mixed value)

Update just about any setting for a campaign that has not been sent.

campaigns(string apikey, array filters, integer start, integer limit)

Get the list of campaigns and their details matching the specified filters

Campaign Stats Methods  

campaignAbuseReports(string apikey, string cid, string since, integer start, integer limit)

Get all email addresses that complained about a given campaign

campaignAdvice(string apikey, string cid)

Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best suited for display in customized reports pages.

campaignAnalytics(string apikey, string cid)

Retrieve the Google Analytics data we've collected for this campaign.

campaignBounceMessages(string apikey, string cid, integer start, integer limit, string since)

Retrieve the full bounce messages for the given campaign.

campaignClickStats(string apikey, string cid)

Get an array of the urls being tracked, and their click counts for a given campaign

campaignEcommOrders(string apikey, string cid, integer start, integer limit, string since)

Retrieve the Ecommerce Orders tracked by campaignEcommAddOrder()

campaignEepUrlStats(string apikey, string cid)

Retrieve stats for your campaign's eepurl.

campaignEmailDomainPerformance(string apikey, string cid)

Get the top 5 performing email domains for this campaign.

campaignGeoOpens(string apikey, string cid)

Retrieve the countries and number of opens tracked for each.

campaignGeoOpensForCountry(string apikey, string cid, string code)

Retrieve the regions and number of opens tracked for a certain country.

campaignHardBounces(string apikey, string cid, integer start, integer limit)

Get all email addresses with Hard Bounces for a given campaign

campaignSoftBounces(string apikey, string cid, integer start, integer limit)

Get all email addresses with Soft Bounces for a given campaign

campaignStats(string apikey, string cid)

Given a list and a campaign, get all the relevant campaign statistics (opens, bounces, clicks, etc.)

campaignUnsubscribes(string apikey, string cid, integer start, integer limit)

Get all unsubscribed email addresses for a given campaign

Campaign AIM Methods  

campaignClickDetailAIM(string apikey, string cid, string url, integer start, integer limit)

Return the list of email addresses that clicked on a given url, and how many times they clicked

campaignEmailStatsAIM(string apikey, string cid, string email_address)

Given a campaign and email address, return the entire click and open history with timestamps, ordered by time

campaignEmailStatsAIMAll(string apikey, string cid, int start, integer limit)

Given a campaign and correct paging limits, return the entire click and open history with timestamps, ordered by time, for every user a campaign was delivered to.

campaignNotOpenedAIM(string apikey, string cid, integer start, integer limit)

Retrieve the list of email addresses that did not open a given campaign

campaignOpenedAIM(string apikey, string cid, integer start, integer limit)

Retrieve the list of email addresses that opened a given campaign with how many times they opened - note: this AIM function is free and does not actually require the AIM module to be installed

Helper Methods  

chimpChatter(string apikey)

Return the current Chimp Chatter messages for an account.

createFolder(string apikey, string name)

Create a new folder to file campaigns in

ecommAddOrder(string apikey, array order)

Import Ecommerce Order Information to be used for Segmentatio.

generateText(string apikey, string type, mixed content)

Have HTML content auto-converted to a text-only format.

getAccountDetails(string apikey)

Retrieve lots of account information including payments made, plan info, some account stats, installed modules, contact info, and more.

getAffiliateInfo(string apikey)

DEPRECATED: Retrieve your User Unique Id and your Affiliate link to display/use for Monkey Rewards.

inlineCss(string apikey, string html, bool strip_css)

Send your HTML content to have the CSS inlined and optionally remove the original styles.

listsForEmail(string apikey, string email_address)

Retrieve all List Ids a member is subscribed to.

ping(string apikey)

"Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good.

List Related Methods  

listAbuseReports(string apikey, string id, integer start, integer limit, string since)

Get all email addresses that complained about a given campaign

listAddStaticSegment(string apikey, string id, string name)

Save a segment against a list for later use.

listBatchSubscribe(string apikey, string id, array batch, boolean double_optin, boolean update_existing, boolean replace_interests)

Subscribe a batch of email addresses to a list at once.

listBatchUnsubscribe(string apikey, string id, array emails, boolean delete_member, boolean send_goodbye, boolean send_notify)

Unsubscribe a batch of email addresses to a list

listDelStaticSegment(string apikey, string id, int seg_id)

Delete a static segment.

listGrowthHistory(string apikey, string id)

Access the Growth History by Month for a given list.

listInterestGroupAdd(string apikey, string id, string group_name, int grouping_id)

Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first group will automatically turn them on.

listInterestGroupDel(string apikey, string id, string group_name, mixed grouping_id, int optional)

Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.

listInterestGroupUpdate(string apikey, string id, string old_name, string new_name, int grouping_id)

Change the name of an Interest Group

listInterestGroupingAdd(string apikey, string id, string name, string type, array groups)

Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first grouping will automatically turn them on.

listInterestGroupingDel(string apikey, int grouping_id)

Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members

listInterestGroupingUpdate(string apikey, int grouping_id, string name, string value)

Update an existing Interest Grouping

listInterestGroupings(string apikey, string id)

Get the list of interest groupings for a given list, including the label, form information, and included groups for each

listInterestGroups(string apikey, string id)

DEPRECATED: Get the list of interest groups for a given list, including the label and form information

listMemberInfo(string apikey, string id, string email_address)

Get all the information for a particular member of a list

listMembers(string apikey, string id, string status, string since, integer start, integer limit)

Get all of the list members for a list that are of a particular status.

listMergeVarAdd(string apikey, string id, string tag, string name, array req)

Add a new merge tag to a given list

listMergeVarDel(string apikey, string id, string tag)

Delete a merge tag from a given list and all its members.

listMergeVarUpdate(string apikey, string id, string tag, array options)

Update most parameters for a merge tag on a given list.

listMergeVars(string apikey, string id)

Get the list of merge tags for a given list, including their name, tag, and required setting

listResetStaticSegment(string apikey, string id, int seg_id)

Resets a static segment - removes all members from the static segment.

listStaticSegmentAddMembers(string apikey, string id, int seg_id, array batch)

Add list members to a static segment.

listStaticSegmentDelMembers(string apikey, string id, int seg_id, array batch)

Remove list members from a static segment.

listStaticSegments(string apikey, string id)

Retrieve all of the Static Segments for a list.

listSubscribe(string apikey, string id, string email_address, array merge_vars, string email_type, boolean double_optin, boolean update_existing, boolean replace_interests, boolean send_welcome)

Subscribe the provided email to a list.

listUnsubscribe(string apikey, string id, string email_address, boolean delete_member, boolean send_goodbye, boolean send_notify)

Unsubscribe the given email address from the list

listUpdateMember(string apikey, string id, string email_address, array merge_vars, string email_type, boolean replace_interests)

Edit the email address, merge fields, and interest groups for a list member.

listWebhookAdd(string apikey, string id, string url, array actions, array sources)

Add a new Webhook URL for the given list

listWebhookDel(string apikey, string id, string url)

Delete an existing Webhook URL from a given list

listWebhooks(string apikey, string id)

Return the Webhooks configured for the given list

lists(string apikey)

Retrieve all of the lists defined for your user account

Security Related Methods  

apikeyAdd(string username, string password, string apikey)

Add an API Key to your account.

apikeyExpire(string username, string password, string apikey)

Expire a Specific API Key.

apikeys(string username, string password, string apikey, boolean expired)

Retrieve a list of all MailChimp API Keys for this User