Mailchimp API
Send Mailchimp campaigns via RelayAPI — create and send email campaigns alongside social media posts in a single API call.
Quick Reference
| Property | Value |
|---|---|
| Platform key | mailchimp |
| Auth method | API Key (includes datacenter) |
| Content format | HTML (plain text auto-wrapped) |
| Scheduling | Yes |
| Analytics | No |
Before You Start
You need a Mailchimp API key. Get one from Mailchimp Account > Extras > API Keys. The key includes your datacenter suffix (e.g., abc123def-us21).
You also need at least one audience/list in your Mailchimp account, and a valid from_email address.
Connect
curl -X POST https://api.relayapi.dev/v1/connect/mailchimp \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"api_key": "your-mailchimp-api-key-us21"
}'Send a Campaign
curl -X POST https://api.relayapi.dev/v1/posts \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Our latest newsletter...",
"targets": ["twitter", "acc_mailchimp123"],
"scheduled_at": "now",
"target_options": {
"mailchimp": {
"subject": "Monthly Update",
"preview_text": "What happened this month",
"from_email": "hello@example.com",
"from_name": "Your Company",
"list_id": "abc123"
}
}
}'target_options Fields
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | No | Email subject line. Falls back to first line of content. |
preview_text | string | No | Preview text for email clients. |
from_email | string | Yes | Sender email address. |
from_name | string | No | Sender display name. |
list_id | string | No | Audience/list ID. If omitted, uses the first list in your account. |
content_html | string | No | Full HTML body. If omitted, plain text is auto-wrapped. |
Discovery
List audiences and templates:
GET /v1/accounts/{id}/lists # Returns Mailchimp audiences
GET /v1/accounts/{id}/templates # Returns Mailchimp templatesAutomations
Mailchimp uses data-center-scoped URLs ({dc}.api.mailchimp.com/3.0). The data center is auto-detected from the API key suffix (-us14) or from metadata.dc.
Triggers
| Type | Fires on |
|---|---|
mailchimp_subscribe | New subscribe event (webhook) |
mailchimp_unsubscribe | Unsubscribe event |
Mailchimp webhooks are form-encoded (not JSON). The inbox normalizer needs a form-parser branch when wiring this platform's webhook route.
Send nodes
Subscriber operations require the MD5 hash of the lowercased email as the identifier.
| Node | Endpoint | Required fields |
|---|---|---|
mailchimp_add_member | PUT /lists/{list}/members/{hash} (upsert) | email, optional double_optin / merge_fields |
mailchimp_add_tag | POST /lists/{list}/members/{hash}/tags | email, tag |
mailchimp_send_campaign | POST /campaigns/{id}/actions/send | campaign_id |
Found something wrong? Help us improve this page.