Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Mailchimp

Scalekit connector
Open markdown

The Mailchimp connector lets your AI agent act in each user's Mailchimp account. Each user signs in to Mailchimp once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 73 tools.

Tools
73
What they doRead · write · destructive
36 · 30 · 736 read30 write7 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Mailchimp connection

    In AgentKit > Connections, create a Mailchimp connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Mailchimp, so you don't need to register an OAuth app. To show your own app on the consent screen, use your own credentials instead.

    Use your own OAuth app

    Register your Mailchimp account with Scalekit so Scalekit handles the OAuth flow and token refresh automatically. The connection name you create is used to identify and invoke the connection in your code.

    1. Set up auth redirects

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find Mailchimp and click Create. Copy the redirect URI — it looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

      Mailchimp connector shown in Scalekit's Create Connection search

      • Log in to your Mailchimp account and go to Account & Billing > Extras > API keys > OAuth apps.

      • Click Register An App, fill in the app details, and paste the redirect URI from Scalekit into the redirect URI field.

    2. Get client credentials

      • In your Mailchimp OAuth app, copy the Client ID and Client Secret.
    3. Add credentials in Scalekit

      • In Scalekit dashboard, open the Mailchimp connection you created and enter:
        • Client ID
        • Client Secret

      • Click Save.
    4. Connect a user account

      • Click the Connected Accounts tab, then Add Account.
      • Enter your user’s ID and click Create Account — you’ll be redirected to Mailchimp to authorize access.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'mailchimp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Mailchimp:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'mailchimp_account_info',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • mailchimp_account_infoRetrieve details about the connected Mailchimp account, including username, contact info, and plan details.Read-only

    Get Account Info

    Retrieve details about the connected Mailchimp account, including username, contact info, and plan details.

    Inputs

    fieldsstring
    Comma-separated list of fields to return.
  • mailchimp_automation_emails_listGet a list of the individual emails (workflow emails) within a Mailchimp classic automation.Read-only

    List Automation Emails

    Get a list of the individual emails (workflow emails) within a Mailchimp classic automation.

    Inputs

    workflow_idstringrequired
    The ID of the automation. Get it from `mailchimp_automations_list`.
  • mailchimp_automation_getRetrieve details about a specific classic automation in Mailchimp.Read-only

    Get Automation

    Retrieve details about a specific classic automation in Mailchimp.

    Inputs

    workflow_idstringrequired
    The ID of the automation. Get it from `mailchimp_automations_list`.
  • mailchimp_automations_listReturn a summary of all classic automations (Email Series) in the Mailchimp account.Read-only

    List Automations

    Return a summary of all classic automations (Email Series) in the Mailchimp account.

    Inputs

    countinteger
    Number of records per page.
    fieldsstring
    Comma-separated fields to return.
    offsetinteger
    Number of records to skip.
    statusstring
    Filter by automation status: `save`, `paused`, `sending`.
  • mailchimp_batch_status_getCheck the status of a Mailchimp batch operation.Read-only

    Get Batch Status

    Check the status of a Mailchimp batch operation. Use this to poll the result of a previously submitted batch request.

    Inputs

    batch_idstringrequired
    The ID of the batch operation. Returned when a batch is created via the Mailchimp API.
  • mailchimp_campaign_content_getRetrieve the content (HTML, plain text, or template) of a Mailchimp campaign.Read-only

    Get Campaign Content

    Retrieve the content (HTML, plain text, or template) of a Mailchimp campaign.

    Inputs

    campaign_idstringrequired
    The ID of the campaign. Get it from `mailchimp_campaigns_list`.
    fieldsstring
    Comma-separated fields to return.
  • mailchimp_campaign_getRetrieve details about a specific Mailchimp campaign.Read-only

    Get Campaign

    Retrieve details about a specific Mailchimp campaign.

    Inputs

    campaign_idstringrequired
    The ID of the campaign. Get it from `mailchimp_campaigns_list`.
    fieldsstring
    Comma-separated fields to return.
  • mailchimp_campaigns_listReturn a list of all campaigns in the Mailchimp account, with optional filters.Read-only

    List Campaigns

    Return a list of all campaigns in the Mailchimp account, with optional filters.

    Inputs

    countinteger
    Number of records per page.
    fieldsstring
    Comma-separated fields to return.
    list_idstring
    Filter by audience ID.
    offsetinteger
    Number of records to skip.
    sort_dirstring
    Sort direction: `ASC` or `DESC`.
    sort_fieldstring
    Sort field: `create_time` or `send_time`.
    statusstring
    Filter by status: `save`, `paused`, `schedule`, `sending`, `sent`.
    typestring
    Filter by campaign type: `regular`, `plaintext`, `absplit`, `rss`, `variate`.

Workflows

Proxy API call
const result = await actions.request({
connectionName: 'mailchimp',
identifier: 'user_123',
path: '/ping',
method: 'GET',
});
console.log(result);
Add a subscriber
const member = await actions.executeTool({
connector: 'mailchimp',
identifier: 'user_123',
toolName: 'mailchimp_list_member_add',
toolInput: {
list_id: 'abc123def',
email_address: 'jane.smith@example.com',
status: 'subscribed',
first_name: 'Jane',
last_name: 'Smith',
},
});
console.log('Added member:', member.id);
Create and send a campaign
const campaign = await actions.executeTool({
connector: 'mailchimp',
identifier: 'user_123',
toolName: 'mailchimp_campaign_create',
toolInput: {
type: 'regular',
list_id: 'abc123def',
subject_line: 'Your April newsletter',
from_name: 'Acme Corp',
reply_to: 'hello@acme.com',
},
});
await actions.executeTool({
connector: 'mailchimp',
identifier: 'user_123',
toolName: 'mailchimp_campaign_content_set',
toolInput: {
campaign_id: campaign.id,
html: '<h1>Hello!</h1><p>Here is your monthly update.</p>',
},
});
await actions.executeTool({
connector: 'mailchimp',
identifier: 'user_123',
toolName: 'mailchimp_campaign_send',
toolInput: { campaign_id: campaign.id },
});
console.log('Campaign sent:', campaign.id);
Get campaign report
const report = await actions.executeTool({
connector: 'mailchimp',
identifier: 'user_123',
toolName: 'mailchimp_report_get',
toolInput: { campaign_id: 'abc123' },
});
console.log(`Opens: ${report.opens.open_rate}, Clicks: ${report.clicks.click_rate}`);