RelayAPI

Mailchimp API

Send Mailchimp campaigns via RelayAPI — create and send email campaigns alongside social media posts in a single API call.

Quick Reference

PropertyValue
Platform keymailchimp
Auth methodAPI Key (includes datacenter)
Content formatHTML (plain text auto-wrapped)
SchedulingYes
AnalyticsNo

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

FieldTypeRequiredDescription
subjectstringNoEmail subject line. Falls back to first line of content.
preview_textstringNoPreview text for email clients.
from_emailstringYesSender email address.
from_namestringNoSender display name.
list_idstringNoAudience/list ID. If omitted, uses the first list in your account.
content_htmlstringNoFull 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 templates

Automations

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

TypeFires on
mailchimp_subscribeNew subscribe event (webhook)
mailchimp_unsubscribeUnsubscribe 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.

NodeEndpointRequired fields
mailchimp_add_memberPUT /lists/{list}/members/{hash} (upsert)email, optional double_optin / merge_fields
mailchimp_add_tagPOST /lists/{list}/members/{hash}/tagsemail, tag
mailchimp_send_campaignPOST /campaigns/{id}/actions/sendcampaign_id

Found something wrong? Help us improve this page.

On this page

Submit an Issue
Requires a GitHub account.View repo