Integrations / Mailchimp
Mailchimp
Mailchimp Marketing API: audiences, members (read, add or update), campaigns and campaign reports.
8 actions
API key
7 read1 write
Calls api.mailchimp.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "mailchimp" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get audiencereadmailchimp.get_audienceGet one audience (list) by ID with its settings and statistics.
| Input | Type | Description | |
|---|---|---|---|
list_id | string | Required | Audience (list) ID |
await setu.execute({
userId: "user_1",
action: "mailchimp.get_audience",
input: {
"list_id": "<list_id>"
},
});Get campaign reportreadmailchimp.get_campaign_reportGet the performance report of one sent campaign: emails sent, opens, clicks, bounces and unsubscribes.
| Input | Type | Description | |
|---|---|---|---|
campaign_id | string | Required | Campaign ID |
await setu.execute({
userId: "user_1",
action: "mailchimp.get_campaign_report",
input: {
"campaign_id": "<campaign_id>"
},
});Get audience memberreadmailchimp.get_memberGet one contact of an audience. subscriber_hash must be the MD5 hash of the lowercased email address: compute it before calling (the plain email address is also accepted by Mailchimp).
| Input | Type | Description | |
|---|---|---|---|
list_id | string | Required | Audience (list) ID |
subscriber_hash | string | Required | MD5 hash of the lowercased email address |
await setu.execute({
userId: "user_1",
action: "mailchimp.get_member",
input: {
"list_id": "<list_id>",
"subscriber_hash": "<subscriber_hash>"
},
});List audiencesreadmailchimp.list_audiencesList the audiences (lists) in the account with member counts and open and click rates.
| Input | Type | Description | |
|---|---|---|---|
count | integer | Optional | Audiences to return (default 10, max 1000) |
offset | integer | Optional | Audiences to skip |
await setu.execute({
userId: "user_1",
action: "mailchimp.list_audiences",
input: {},
});List campaign reportsreadmailchimp.list_campaign_reportsList the reports of sent campaigns, newest first, with sent, open and click numbers for each.
| Input | Type | Description | |
|---|---|---|---|
count | integer | Optional | Reports to return (default 10, max 1000) |
offset | integer | Optional | Reports to skip |
await setu.execute({
userId: "user_1",
action: "mailchimp.list_campaign_reports",
input: {},
});List campaignsreadmailchimp.list_campaignsList campaigns, optionally only those with one status (save, paused, schedule, sending, sent) or of one type.
| Input | Type | Description | |
|---|---|---|---|
status | string | Optional | Only campaigns with this status |
type | string | Optional | Only campaigns of this type |
count | integer | Optional | Campaigns to return (default 10, max 1000) |
offset | integer | Optional | Campaigns to skip |
await setu.execute({
userId: "user_1",
action: "mailchimp.list_campaigns",
input: {},
});List audience membersreadmailchimp.list_membersList the contacts in an audience, optionally only those with one status (subscribed, unsubscribed, cleaned, pending, transactional).
| Input | Type | Description | |
|---|---|---|---|
list_id | string | Required | Audience (list) ID |
status | string | Optional | Only members with this status |
count | integer | Optional | Members to return (default 10, max 1000) |
offset | integer | Optional | Members to skip |
await setu.execute({
userId: "user_1",
action: "mailchimp.list_members",
input: {
"list_id": "<list_id>"
},
});Add or update audience memberwritemailchimp.upsert_memberAdd a contact to an audience or update an existing one (PUT). subscriber_hash is the MD5 hash of the lowercased email address: compute it first. status_if_new is required for contacts not yet in the audience.
| Input | Type | Description | |
|---|---|---|---|
list_id | string | Required | Audience (list) ID |
subscriber_hash | string | Required | MD5 hash of the lowercased email address |
email_address | string | Required | The contact's email address |
status_if_new | string | Optional | Status to give a contact who is not yet in the audience |
status | string | Optional | New status for the contact (subscribed, unsubscribed, ...) |
merge_fields | object | Optional | Merge tag values, e.g. {FNAME: 'Urist', LNAME: 'McVankab'} |
tags | array of string | Optional | Tags to set on the contact |
await setu.execute({
userId: "user_1",
action: "mailchimp.upsert_member",
input: {
"list_id": "<list_id>",
"subscriber_hash": "<subscriber_hash>",
"email_address": "<email_address>"
},
});