InTouch Hub · Blue Isle Software

Mailchimp

Mailchimp Marketing API — manage audiences (lists), list members, and campaigns.

mailchimpemailmarketingcampaigns

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

Outputs

How to get the API key

  1. Log in to Mailchimp.
  2. Go to Account & billing → Extras → API keys.
  3. 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.