Most email marketers manage Mailchimp through its web dashboard: clicking into audiences, building campaigns one at a time, manually checking open rates after every send. That workflow does not scale once you are running multiple lists, weekly campaigns, and ongoing A/B tests. OpenClaw can take over the repetitive parts. Connect Mailchimp to OpenClaw through a custom skill, and your AI agent handles subscriber lookups, campaign performance checks, and list hygiene directly from your chat app.
This guide covers the full integration: generating your Mailchimp API key, understanding the data center prefix, writing a complete SKILL.md file, and building automations for the use cases email marketers care about most. If OpenClaw is already running, you can have this working in about 15 minutes.
What This Integration Gives You
Once connected, your OpenClaw agent talks directly to the Mailchimp Marketing API (v3). Instead of clicking through Mailchimp’s interface, you message your agent in Telegram, WhatsApp, or Slack and it handles the API calls.
Here is what that looks like in practice:
- Subscriber management from chat: add contacts, update tags, check subscription status, or remove bounced addresses
- Campaign monitoring without opening Mailchimp: ask for open rates, click rates, and unsubscribe counts from your last send
- A/B test result summaries delivered to you automatically when a test finishes
- List hygiene on autopilot: scheduled scans for cleaned or unsubscribed contacts, with summaries sent to your Telegram group
- Quick audience lookups: “How many subscribers are on our product launch list?” answered in seconds
The agent uses Mailchimp’s REST API through an API key. No third-party middleware, no paid Zapier tier. Your data flows between your machine and Mailchimp’s servers directly.
Before You Start
Three things need to be in place:
-
OpenClaw installed and running. If you have not done this yet, follow our OpenClaw setup guide first. That covers installation, workspace files, memory, and Telegram configuration.
-
A Mailchimp account. The free plan (500 contacts, 1,000 monthly sends) includes full API access. Standard and Premium plans unlock more contacts and advanced features, but the API endpoints work the same across all tiers.
-
A text editor for writing your skill file. VS Code, Cursor, or anything that handles Markdown.
Step 1: Get Your Mailchimp API Key
Mailchimp uses API keys for authentication. Unlike HubSpot’s scoped Private Apps, a Mailchimp API key grants full access to your account. There is no way to restrict it to specific endpoints. That makes token storage and security especially important.
Generate the Key
- Log into Mailchimp and click your profile icon (bottom left)
- Go to Profile > Extras > API keys
- In the “Your API keys” section, click Create A Key
- Give it a descriptive name:
OpenClaw Integration - Click Generate Key
- Copy the key immediately. Mailchimp only shows the full key once. If you navigate away, you will need to generate a new one.
Understand the Data Center Prefix
Your API key looks something like this:
8f7g6d5e4c3b2a1f8g7d6e5c4b3a2f1e-us14
The string after the dash (us14) is your data center prefix. Every Mailchimp API request routes to https://{dc}.api.mailchimp.com/3.0/, where {dc} is that prefix. If you cut it off when copying, every API call fails with a routing error. This trips people up more than any other step.
You can also find your data center by looking at the URL when logged into Mailchimp. If the URL starts with https://us14.admin.mailchimp.com, your data center is us14.
Store the Key Safely
Do not paste the key directly into your skill file. Store it in your .env file:
# ~/.env or ~/openclaw/.env
MAILCHIMP_API_KEY=8f7g6d5e4c3b2a1f8g7d6e5c4b3a2f1e-us14
MAILCHIMP_SERVER_PREFIX=us14
We store the server prefix separately because the skill file references it in URL construction. This avoids parsing it from the key at runtime.
Step 2: Write the OpenClaw Mailchimp Skill
OpenClaw skills are Markdown files that teach your agent how to use external tools. Each skill lives in your workspace’s skills/ directory and contains templated API calls the agent adapts based on your requests. For a deeper look at skill authoring, see our skills development guide.
Create the Skill Directory
mkdir -p ~/.openclaw/workspace/skills/mailchimp
Write the SKILL.md File
Create ~/.openclaw/workspace/skills/mailchimp/SKILL.md with this content:
---
name: mailchimp
description: Manage Mailchimp email marketing. Search subscribers, check campaign performance, manage audience lists, and monitor A/B tests via the Mailchimp Marketing API v3.
tools:
- shell
---
# Mailchimp Email Marketing Skill
## Authentication
Use environment variables for all requests:
- API Key: $MAILCHIMP_API_KEY
- Server prefix: $MAILCHIMP_SERVER_PREFIX
- Base URL: https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0
All requests use HTTP Basic Auth:
--user "anystring:$MAILCHIMP_API_KEY"
## Available Operations
### Test the Connection
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/ping" | jq '.'
Expected response: {"health_status": "Everything's Chimpy!"}
### List All Audiences
Note: Mailchimp calls these "audiences" in the UI but "lists" in the API.
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/lists?fields=lists.id,lists.name,lists.stats.member_count&count=100" \
| jq '.lists[] | {id: .id, name: .name, members: .stats.member_count}'
### Look Up a Subscriber
Mailchimp identifies subscribers by the MD5 hash of their lowercase email address.
EMAIL="user@example.com"
MD5_HASH=$(echo -n "${EMAIL,,}" | md5sum | awk '{print $1}')
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/lists/LIST_ID/members/$MD5_HASH" \
| jq '{email: .email_address, status: .status, name: (.merge_fields.FNAME + " " + .merge_fields.LNAME), tags: [.tags[].name]}'
### Add a New Subscriber
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
-H "Content-Type: application/json" \
-X POST "https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/lists/LIST_ID/members" \
-d '{
"email_address": "NEW_EMAIL",
"status": "subscribed",
"merge_fields": {
"FNAME": "FIRST_NAME",
"LNAME": "LAST_NAME"
}
}' | jq '{id: .id, email: .email_address, status: .status}'
### Update Subscriber Tags
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
-H "Content-Type: application/json" \
-X POST "https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/lists/LIST_ID/members/$MD5_HASH/tags" \
-d '{
"tags": [
{"name": "TAG_NAME", "status": "active"}
]
}'
### Get Recent Campaigns
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/campaigns?status=sent&sort_field=send_time&sort_dir=DESC&count=10" \
| jq '.campaigns[] | {id: .id, title: .settings.title, subject: .settings.subject_line, sent: .send_time}'
### Get Campaign Performance Report
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/reports/CAMPAIGN_ID" \
| jq '{subject: .subject_line, sent: .emails_sent, opens: .opens.unique_opens, open_rate: .opens.open_rate, clicks: .clicks.unique_clicks, click_rate: .clicks.click_rate, unsubs: .unsubscribed, bounces: .bounces.hard_bounces}'
### Get A/B Test Sub-Reports
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/reports/CAMPAIGN_ID/sub-reports" \
| jq '.children[] | {id: .id, subject: .subject_line, open_rate: .opens.open_rate, click_rate: .clicks.click_rate}'
### Find Cleaned or Unsubscribed Members
curl -s --user "anystring:$MAILCHIMP_API_KEY" \
"https://$MAILCHIMP_SERVER_PREFIX.api.mailchimp.com/3.0/lists/LIST_ID/members?status=cleaned&count=100" \
| jq '.members[] | {email: .email_address, reason: .unsubscribe_reason}'
## Rules
- Always confirm before adding or removing subscribers. Show the user the email, list name, and intended action before executing.
- When looking up subscribers, compute the MD5 hash of the lowercase email. This is required by the Mailchimp API.
- For campaign reports, always include open rate, click rate, and unsubscribe count.
- Mailchimp rate limits allow 10 concurrent connections. Space batch operations accordingly.
- Never log the API key in responses, memory files, or chat messages.
- When the user says "list" or "audience," treat them as the same thing. The API uses "lists" while the UI uses "audiences."
What Each Section Does
The frontmatter tells OpenClaw when to activate this skill. When you mention email, campaigns, subscribers, or Mailchimp, the agent loads this skill and gains access to the shell tool for running curl commands.
The operations section gives your agent templated API calls. When you ask “What was the open rate on our last campaign?”, the agent reads the campaign report endpoint, finds the most recent campaign ID, runs the curl command, and parses the JSON. It adapts the templates to your specific question.
The rules section sets boundaries. The confirmation rule prevents accidental subscriber additions or deletions. The MD5 hashing rule is essential because Mailchimp’s member endpoint rejects raw email addresses.
One gotcha worth knowing: Mailchimp’s API refers to audiences as “lists” everywhere. Your agent might get confused if a user says “audience” and the API only accepts “list” in the endpoint path. The rules section handles that disambiguation.
Step 3: Test the Connection
Restart OpenClaw to load the new skill:
openclaw gateway restart
Then open your chat app and run these tests in order:
Connection test:
“Ping my Mailchimp account”
The agent should return Everything's Chimpy! from the /ping endpoint.
Audience test:
“List my Mailchimp audiences with subscriber counts”
You should see your audience names, IDs, and member counts.
Subscriber test:
“Look up jane@example.com in our main list”
The agent needs to MD5-hash the email and query the members endpoint. If it returns the subscriber’s name, status, and tags, the integration is working end to end.
Campaign test:
“Show me the performance of our last 3 campaigns”
The agent should pull recent sent campaigns and return open rates, click rates, and unsubscribe counts.
If any test fails, check these common causes:
| Symptom | Likely Cause | Fix |
|---|---|---|
| 401 Unauthorized | API key is wrong | Regenerate in Mailchimp > API keys |
| Could not resolve host | Data center prefix is wrong or missing | Check the suffix of your API key |
| 404 on member lookup | MD5 hash is incorrect | Verify the agent is hashing the lowercase email |
| Empty campaign list | No sent campaigns yet | Send a test campaign first |
What to Automate First
The best approach is to start with read-only operations, verify the agent returns accurate data, and then add write operations and scheduled automations.
Week 1: Campaign Monitoring
Use your agent for quick checks throughout the week:
- “What was the open rate on Tuesday’s newsletter?”
- “Compare the click rates of our last two campaigns”
- “How many people unsubscribed from the product update email?”
This builds your confidence that the agent reads Mailchimp data correctly. Cross-check a few results against the Mailchimp dashboard to make sure numbers match.
Week 2: Subscriber Management
Once monitoring feels reliable, add write operations:
- “Add sarah@newclient.com to our onboarding list with the tag ‘enterprise-trial’”
- “What tags does john@customer.com have? Add ‘webinar-attended’ to his profile”
- “Remove all contacts with ‘cleaned’ status from the product updates list”
Week 3: Scheduled Automations
Use OpenClaw’s heartbeat or cron jobs for recurring tasks:
Add this to your heartbeat.md:
## Weekly List Hygiene Report
Every Monday at 9:00 AM, check all Mailchimp audiences for contacts with
"cleaned" or "unsubscribed" status added in the last 7 days.
Send me a summary with the count per audience and the top bounce reasons.
Or set up A/B test monitoring:
## A/B Test Result Alerts
After any A/B test campaign completes, pull the sub-reports and send me
the winning variant with its open rate, click rate, and the margin of
difference. Flag any test where the difference is within 1 percentage
point as statistically inconclusive.
This progression (read, then write, then schedule) protects you from accidental subscriber modifications while you are still learning how the agent interprets your instructions.
Security Considerations
Mailchimp API keys grant full account access. There is no scope restriction like HubSpot’s Private Apps offer. That means a leaked key gives complete control over your audiences, campaigns, and billing settings.
Token storage. Keep the key in a .env file outside your workspace directory. Never put it in agents.md, soul.md, or any workspace file. If your agent logs a response that includes the key, rotate it immediately.
Confirmation rules. The skill’s Rules section requires the agent to confirm before any write operation. This is your safety net. If your agent starts adding subscribers without asking first, strengthen the confirmation instruction or add an explicit deny-list for bulk operations.
Audience access. If you run multiple Mailchimp audiences for different products or clients, consider adding a rule that lists which audience IDs the agent can access. This prevents a misunderstood instruction from writing to the wrong list.
Audit trail. Mailchimp logs API activity in your account’s activity feed. Review it periodically, especially in the first few weeks, to verify the agent is making the calls you expect.
For broader OpenClaw security practices, see Step 9 in our OpenClaw setup guide.
Frequently Asked Questions
Do I need a paid Mailchimp plan to use the API?
No. Mailchimp’s free plan includes full Marketing API access. You can manage subscribers, pull campaign reports, and run automations through the API without upgrading. The free tier limits you to 500 contacts and 1,000 monthly email sends, but the API endpoints themselves are unrestricted.
What is a data center prefix and where do I find it?
The data center prefix is the short code at the end of your API key, after the dash. If your key ends in -us14, your data center is us14. Every API request goes to https://us14.api.mailchimp.com/3.0/. You can also see it in your Mailchimp URL when logged in. Getting this wrong is the most common reason API calls fail with a “could not resolve host” error.
Why does subscriber lookup require an MD5 hash?
Mailchimp’s API identifies individual subscribers by the MD5 hash of their lowercase email address, not the email itself. This is a design choice in their API. When your agent looks up Jane@Example.com, it must first lowercase it to jane@example.com, then compute the MD5 hash, and use that hash in the API endpoint path. The SKILL.md file includes this step in the subscriber lookup template.
Can OpenClaw send Mailchimp campaigns automatically?
Yes. The Mailchimp API includes a /campaigns/{id}/actions/send endpoint that triggers a campaign send. However, we recommend keeping this as a manual confirmation step in your skill’s Rules section. An accidental send to your entire list is difficult to undo. Use automated sends only for test campaigns or small segments where a mistake is recoverable.
How does Mailchimp’s rate limiting work?
Mailchimp limits you to 10 concurrent connections rather than a fixed number of requests per second. For normal conversational use through OpenClaw, you will never hit this limit. It only becomes relevant if you run batch operations across multiple audiences simultaneously. If the agent receives a 429 response, it should wait a few seconds and retry.
Can I use this integration from WhatsApp or Slack instead of Telegram?
Yes. OpenClaw supports Telegram, WhatsApp, Slack, Discord, and iMessage. The Mailchimp skill works identically regardless of which chat app you use. For 24/7 availability across all channels, you can run OpenClaw on a VPS like Hostinger.
Key Takeaways
- Connect Mailchimp to OpenClaw by generating an API key, noting your data center prefix, and writing a custom SKILL.md file with templated curl commands
- Store the API key in a
.envfile, never inside workspace files your agent reads into context - Start with read-only operations (campaign reports, subscriber lookups) before enabling write operations
- Use heartbeat or cron automations for recurring tasks like list hygiene scans and A/B test result alerts
- Mailchimp API keys grant full account access with no scope restrictions, so confirmation rules in your skill file are critical
SFAI Labs