Setting up Mailchimp Webhooks Integration: A Comprehensive Guide

Ofem Eteng • Last Modified: December 29th, 2022

Mailchimp Webhooks Integration- Featured Image

Increasing your brand presence in a crowded market is of utmost importance to remaining relevant and having a competitive edge. Having the right knowledge about your client’s needs and desires can go a long way in shaping your decision making towards their specific requirements. There are various tools available that can help you in connecting with clients/customers in personal ways to foster rewarding and lasting relationships.

This article aims at showing you how to achieve Mailchimp Webhooks integration and set up custom events through Webhooks in the powerful email marketing platform, Mailchimp. A Webhook is a tool to collect information about your contacts. It can help alert your application when a campaign has finished sending emails or when it discovers an invalid email address. Webhooks integrations can also sync your client’s profile data with your database. Such integrations with Mailchimp can boost your marketing performance as you design a tailored approach to each customer.

Let’s see how this blog is structured for you:

What is Mailchimp?

Mailchimp Webhooks Integration: Mailchimp Logo
Image Source: Drupal

Mailchimp is a marketing platform cum email marketing service that offers small and medium scale businesses access to industry-leading tools with which they can engage their customers through email marketing and automated workflows. In the field of marketing, email has shown a very high Return on Investment (ROI) and is still one of the most powerful marketing channels available. Mailchimp is a leader in this market segment as it provides not only email marketing services but integrates a suite of other services such as surveys and automated workflows for seamless interactions between businesses and customers to help create enduring brand appeal.

Mailchimp is owned by Rocket Science Group, an American company founded in 2001 by Ben Chestnut and Mark Armstrong along with Dan Kurzius. It is believed that in June 2014, Mailchimp was sending over 10 billion emails per month on behalf of its users.

The major focus of Mailchimp is to provide contact management, create beautifully designed email campaigns, and provide powerful data analysis.

What is Webhooks?

Mailchimp Webhooks Integration: Webhooks Logo
Image Source: Zoko API

A Webhook sometimes called a web callback or HTTP Push API; is a way for an application to communicate with other applications. It takes the form of message passing, whereby an application sends a message or payload to another application, a predetermined event also occurs in the source application simultaneously. Since the nature of Webhook is based on events, it avoids the limitations of polling as the application that needs to be notified of a change does not need to constantly poll (ask) the source application whether that change has occurred. Also, check out Webhook to BigQuery integration.

With Webhooks, whenever the agreed-upon event happens, a message is sent to the consuming application via an HTTP request to the callback URL (the specified API endpoint for the consuming application). Webhooks are a resource-light way to implement event reaction between applications as they are much more efficient for both providers and consumers.

Hevo Data: Integrate your Data Conveniently

Hevo is a No-code Data Pipeline. It supports pre-built integration from Mailchimp along with other free data sources. It will automate your data flow in minutes. Its fault-tolerant architecture makes sure that your data is secure, reliable and consistent. With Hevo, data integrations become a cakewalk.

Get Started with Hevo for Free

Let’s look at some unbeatable features of Hevo:

  1. Fully Automated: Hevo can be set-up in a few minutes and requires zero maintenance and management.
  2. Scalability: Hevo is built to handle millions of records per minute without any latency.
  3. Secure: Hevo offers two-factor authentication and end-to-end encryption so that your data is safe and secure.
  4. Fault-Tolerant: Hevo is capable of detecting anomalies in the incoming data and informs you instantly. All the affected rows are kept aside for correction so that it doesn’t hamper your workflow.
  5. Real-Time: Hevo provides real-time data migration. So, your data is always ready for analysis.
  6. Live Support: Hevo team is available round the clock to extend exceptional support to its customers through chat, email, and support calls.

Are you ready to use Hevo? If yes, then give it a try by signing up for a 14-day free trial today.

Sign up here for a 14-Day Free Trial!

Mailchimp Webhooks Integration

In Mailchimp, Webhooks collects information about an audience (contacts) in a marketing campaign. It gathers information about an audience immediately, whenever any changes occur within that audience, be it when a campaign has finished sending emails or when a contact changes their email address. It is achieved by setting up a valid URL that accepts HTTP POST requests. Information received from the Webhook ranges from updates on subscriptions, e-commerce reporting for Facebook ads, landing pages activity, click reports in a campaign, opened email reports of recipients in a campaign, etc. 

Note: To set up Webhooks in Mailchimp, you should have a Mailchimp account, an audience you would like to use a Webhook with, a callback URL for your application that can accept HTTP POST requests, an API key and server prefix. Follow these steps to achieve Mailchimp Webhooks integration:

1. Set up your Callback URL

To create a Webhook, the first thing you need is to have a callback URL that accepts HTTP POST requests. Mailchimp sends an HTTP POST request to the specified URL whenever a Webhook is triggered.

2. Create a New Webhook

A new Webhook can be set up in the Mailchimp web app or through the API. This section focuses on using the Mailchimp app for Mailchimp Webhook integration. 

To create a Webhook, carry out the following steps: 

  1. Log into your Mailchimp account and navigate to the Audience page.
  2. Select the audience you want to work with from the Current Audience dropdown.
  3. Click the Manage Audience dropdown button and select Settings.
  4. On the Settings page, click Webhooks.
  5. Click the Create New Webhook button.
  6. In the Callback URL field, add the URL of the integration or application where Webhook requests will be sent. 
  7. Select the boxes next to each update type to choose the events that will trigger your Webhook, for example, Subscribes and Unsubscribes.
  8. Click Save to save your new Webhook.

3. Handling the Webhook Response in your Application

After setting up the Webhook, you need to handle the callback data in your application. The Webhook request is sent as application/x-www-form-urlencoded data, and the alert received by the triggered event is parsed as a JSON. Do note that the Webhook data codes are accessible through the Webhook URL that you set up. Examples of the JSON for the Subscribes and Unsubscribes events are shown below.  

  "type": "subscribe",
  "fired_at": "2009-03-26 21:35:57",
  "data": {
    "id": "8a25ff1d98",
    "list_id": "a6b5da1054",
    "email": "",
    "email_type": "html",
    "ip_opt": "",
    "ip_signup": ""
    "merges": {
      "EMAIL": "",
      "FNAME": "Mailchimp",
      "LNAME": "API",
      "INTERESTS": "Group1,Group2"

  "type": "unsubscribe",
  "fired_at": "2009-03-26 21:40:57",
  "data": {
    "action": "unsub",
    "reason": "manual",
    "id": "8a25ff1d98",
    "list_id": "a6b5da1054",
    "email": "",
    "email_type": "html",
    "ip_opt": "",
    "campaign_id": "cb398d21d2",
    "merges": {
      "EMAIL": "",
      "FNAME": "Mailchimp",
      "LNAME": "API",
      "INTERESTS": "Group1,Group2"

The next thing to do is to write the code that will handle the Webhook data on your server. Below is a sample code in JavaScript (NodeJS) using the Express web framework. The code uses a dummy stand-in customerDB with functions to interact with a database using Subscribes and Unsubscribes events.

const express = require("express");
const bodyParser = require("body-parser");
// this is a stand-in for the code you'd use to write to your own database
const customerDB = require("customerDB");
const app = express();
app.use(bodyParser.urlencoded({ extended: true }));"/", (req, res) => {
 const { type, data } = req.body;
 if (type === "subscribe") {
 } else if (type === "unsubscribe") {
app.listen(port, () =>
 console.log(`Listening at http://localhost:3000`)

4. Test your Webhook

If you have completed an appropriate code set-up, you can test your Webhook in the Mailchimp app. The steps, as stated below, is used to test for a subscription event.

  1. Go to the Audience page and select the audience you would like to add a test member.
  2. In the Add Contacts dropdown, select Add a Subscriber.
  3. Fill in the input fields with information for your test email account.
  4. Check the checkbox for “This person gave me permission to email them”, if you would like to skip the step of confirming the subscription manually.
  5. Hit Subscribe.
  6. Your server should receive the Webhook request, and your database should be updated accordingly.

For further reading, visit the official documentation page for Mailchimp synchronization.


In this article, you have gone through the process of setting up Mailchimp Webhooks integration to receive alerts when an event takes place. It was done using examples of Subscribes and Unsubscribes events. These custom alerts, when set up for an audience, is useful to know your contact’s subscription status, therefore helping you in drawing up appropriate strategies to build sustainable customer relationships. There are alternative methods for setting up Mailchimp Webhooks integration, such as using Hevo Data.

Visit our Website to Explore Hevo

Hevo is a No-code data pipeline that supports pre-built integration from Mailchimp along with other free data sources and can simplify the process of managing your Mailchimp Webhooks integration. You don’t need to write custom code but will be able to access all the benefits associated with Webhooks through a point and click interface.

Give Hevo a try by and Sign Up for a 14-day free trial today.

Share your experience of Mailchimp Webhooks integration in the comment section below.

No-code Data Pipeline for Mailchimp