InTouch Hub · Blue Isle Software

Mailchimp

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

Provided free and as is, without warranty of any kind — including merchantability, fitness for a particular purpose, and the accuracy or completeness of any result. See the licence. You are responsible for checking what this produces before relying on it.

billingcampaignsemaillogmarketingmarketing-emailstatus

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.

Publishes

The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.

Input Properties

Every property this tool accepts, from its own tool.iml.

Property Type Required Default Description
apiKey string yes DEPRECATED — bind an API Key credential to the task with credentialName instead. A key pasted here is stored in the workflow definition in clear and appears in every export of it. Still honoured for workflows built before the change.
operation string yes One of: ping, list-audiences, list-members, add-member, list-campaigns
listId string no Audience/list id. Required for list-members and add-member.
email string no Contact email address. Required for add-member.
status string no subscribed Member status for add-member: subscribed, unsubscribed, pending, or cleaned. Defaults to subscribed.
count string no 10 Max number of records to return for list-audiences, list-members, list-campaigns (1-1000). Defaults to 10.