MailChimp API v1.1 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.

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

For Serialized JSON, use:

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

For Serialized XML, use:

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

For Serialized PHP, use:

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

For Serialized LOLCODE, use:

http://<dc>.api.mailchimp.com/1.1/?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.

Noteworty 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 a RSS campaign from sending

campaignReplicate(string apikey, string cid)

Replicate a campaign.

campaignResume(string apikey, string cid)

Resume sending a 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

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, string filter_id, integer filter_folder, string filter_fromname, string filter_fromemail, string filter_title, string filter_subject, string filter_sendtimestart, string filter_sendtimeend, boolean filter_exact, integer start, integer limit)

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

Campaign Stats Methods  

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

Get all email addresses that complained about a given campaign

campaignClickStats(string apikey, string cid)

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

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, mixed 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, integer 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  

createFolder(string apikey, string name)

Create a new folder to file campaigns in

generateText(string apikey, string type, mixed content)

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

getAffiliateInfo(string apikey)

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.

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  

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

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

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.

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)

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, 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, boolean 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.

listMergeVars(string apikey, string id)

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

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

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

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