Mailchimp
InTouch Hub tool for the Mailchimp Marketing API (API v3.0). Read and manage your Mailchimp audiences (lists), audience members, and email campaigns.
What it does
Calls the Mailchimp Marketing API at https://<dc>.api.mailchimp.com/3.0 using
HTTP Basic authentication. The data center prefix <dc> is parsed automatically
from the suffix of your API key (the part after the dash, e.g. ...-us19).
Standard-library Python only — no external dependencies. Response bodies are
capped at 5 MB. The full JSON response is returned in result, with the HTTP
status code alongside it.
Operations
| operation | HTTP call | Required params |
|---|---|---|
ping |
GET /ping |
— |
list-audiences |
GET /lists?count=N |
— |
list-members |
GET /lists/{listId}/members?count=N |
listId |
add-member |
POST /lists/{listId}/members |
listId, email |
list-campaigns |
GET /campaigns?count=N |
— |
Inputs
apiKey(required) — your Mailchimp Marketing API key.operation(required) — one of the operations above.listId— audience/list id (used bylist-membersandadd-member).email— contact email address (used byadd-member).status— member status foradd-member:subscribed(default),unsubscribed,pending, orcleaned.count— max records for the list operations (1–1000, default 10).
Outputs
result— the raw JSON response body from Mailchimp (as a string).status— the HTTP status code (e.g.200,400).
How to get the API key
- Log in to Mailchimp.
- Go to Account & billing → Extras → API keys.
- Click Create A Key and copy it. It looks like
0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d-us19.
The trailing -us19 (your data center) is required and is read automatically by
this tool — paste the whole key as-is.
Usage examples
List your audiences:
apiKey: 0a1b2c...-us19
operation: list-audiences
count: 5
Returns the lists array — grab a list.id from there for the next call.
Add a contact to an audience:
apiKey: 0a1b2c...-us19
operation: add-member
listId: a1b2c3d4e5
email: [email protected]
status: subscribed
Returns the created member record (id, email_address, status, ...).
A 400 with title: "Member Exists" means the email is already on that list.