1) How to create an API key
Note
This article refers only to API keys for the Mailchimp Marketing API. To learn more about the Mailchimp Transactional API, check out the Transactional API Quick Start Guide.
What is an API?
API stands for application programming interface. Think of an API as a way for different apps to talk to one another. You send and receive data between apps using API requests and responses. An API key is a unique series of characters that’s included in a request to verify that the requesting system is allowed to communicate with the receiving system.
Generate an API key
You’ll often need to generate an API key when you set up an integration with your Mailchimp account. Users with Manager permissions can generate their own API keys. Users with Admin permissions can also see the API keys other account users have generated.
Note
You’ll only be able to see the full API key immediately after you generate it. After that, you’ll only see the name you’ve given it and its first 4 digits.
To generate an API key, follow these steps.
Click your profile icon and choose Profile.
Click the Extras drop-down then choose API keys.
In the Your API Keys section, click Create A Key.
Name your key. Be descriptive, so you know what app uses that key. Keep in mind that you’ll see only this name and the first 4 key digits on your list of API keys.
Click Generate Key.
Once we generate your key, click Copy Key to Clipboard. Save your key someplace secure–you won’t be able to see or copy it again. If you lose this key, you’ll need to generate a new key and update any integration that uses it.
Click Done.
Revoke an API key
If an API key has been compromised, or you no longer use the integration that was accessing your account through it, you can revoke that API key. Once you’ve revoked an API key, it can’t be reactivated. You’ll need to generate a new key and update any integrations that use the original key.
To revoke an API key, follow these steps.
Click your profile icon and choose Profile.
Click the Extras drop-down then choose API keys.
Find the API key you want to revoke and click Revoke.
In the pop-up modal, type REVOKE then click Revoke to confirm your action.
API key security
API keys grant full access to your Mailchimp account. You should protect them the same way you would protect your password. Keep these common scenarios in mind when working with API keys.
Give each integration its own API key. Assign descriptive names to each key so you know which key goes with which app. If a specific API key is compromised, you can revoke that key without disabling access to your other integrations.
Be careful not to expose the key to the public (such as in screenshots, videos, or help documents). Remember that blurring your data isn't always enough. It's best to remove the data completely.
Because of the potential security risks that come with exposing account API keys, Mailchimp doesn’t support client-side implementation of our API using CORS requests or including API keys in mobile apps.
If you need to share access to your account, generate a new key and name it so you’ll know which key to revoke, if needed. Never email an API key. This could allow access to your Mailchimp account if hackers were to compromise your email account.
If you revoke a user's access to your Mailchimp account, we’ll remove any API keys that user generated from your account.
The role of the user who generated the API key determines access to each endpoint. To learn more about user level permissions, visit Manage User Levels in Your Account.
API support
Our Mailchimp Support team isn't trained for in-depth API troubleshooting. If you need a developer to help you configure something using the API, check out our great Experts Directory. This lists third-party Mailchimp experts who can be hired to help out.
If you're a developer who wants to build your own integration with Mailchimp, check out our API documentation.
2) How to get the list ID
Find Your Audience ID
Each Mailchimp audience has a unique audience ID (sometimes called a list ID) that integrations, plugins, and widgets may require to connect and transfer subscriber data. The audience ID is generated by our system when the audience is created and cannot be changed.
In this article, you’ll learn how to find your audience ID.
Find your audience ID
To find your audience ID, follow these steps.
Click Audience.
Click All contacts.
If you have more than one audience, click the Current audience drop-down and choose the one you want to work with.
Click the Settings drop-down and choose Audience name and defaults.
In the Audience ID section, you’ll see a string of letters and numbers. This is your audience ID.
3) Events and starting points
Subscribfy will send events to Mailchimp when the following happen:
a new membership is created
a membership is cancelled
a membership is paused
a membership is reactivated
a succesful membership charge happened
a failed membership charge happened
When creating journeys you can use the following starting points from Events API:
membership_created
membership_cancelled
membership_paused
membership_reactivated
succesful_charge
failed_charge
recharge_email_notification
When creating the email for the journey you can personalize them with these custom properties :
subscription_status
next_billing_date
store_credit
manage_page_link
You can find more documentation on how to use custom properties in Mailchimp here.