KosmoKrator

productivity

Mailchimp CLI for AI Agents

Use the Mailchimp CLI from KosmoKrator to call Mailchimp tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

18 functions 9 read 9 write API key auth

Mailchimp CLI Setup

Mailchimp can be configured headlessly with `kosmokrator integrations:configure mailchimp`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure mailchimp --enable --read allow --write ask --json
kosmokrator integrations:doctor mailchimp --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

No credentials are required.

Call Mailchimp Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call mailchimp.mailchimp_list_audiences '{
  "count": 1,
  "offset": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:mailchimp mailchimp_list_audiences '{
  "count": 1,
  "offset": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs mailchimp --json
kosmo integrations:docs mailchimp.mailchimp_list_audiences --json
kosmo integrations:schema mailchimp.mailchimp_list_audiences --json
kosmo integrations:search "Mailchimp" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Mailchimp.

mailchimp.mailchimp_list_audiences

Read read

List all audiences (lists) in the connected Mailchimp account. Returns each audience's ID, name, subscriber count, and other metadata. Supports offset-based pagination via the count and offset parameters.

Parameters
count, offset

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_list_audiences '{"count":1,"offset":1}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_list_audiences '{"count":1,"offset":1}' --json

mailchimp.mailchimp_get_audience

Read read

Get full details for a single Mailchimp audience (list) by its ID. Returns the audience name, contact information, subscription stats, and default settings.

Parameters
id

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_get_audience '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_get_audience '{"id":"example_id"}' --json

mailchimp.mailchimp_create_audience

Write write

Create a new audience (list) in Mailchimp. Requires a name, contact information, permission reminder, and campaign defaults. Returns the newly created audience with its ID.

Parameters
name, contact, permission_reminder, email_type_option, campaign_defaults

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_create_audience '{"name":"example_name","contact":"example_contact","permission_reminder":"example_permission_reminder","email_type_option":true,"campaign_defaults":"example_campaign_defaults"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_create_audience '{"name":"example_name","contact":"example_contact","permission_reminder":"example_permission_reminder","email_type_option":true,"campaign_defaults":"example_campaign_defaults"}' --json

mailchimp.mailchimp_add_subscriber

Write write

Add a new subscriber or update an existing one in a Mailchimp audience. Uses a PUT upsert based on the subscriber's email address (MD5 hash). Optionally set merge fields and initial tags. Returns the subscriber record with their ID and status.

Parameters
list_id, email, status, merge_fields, tags

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_add_subscriber '{"list_id":"example_list_id","email":"example_email","status":"example_status","merge_fields":"example_merge_fields","tags":"example_tags"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_add_subscriber '{"list_id":"example_list_id","email":"example_email","status":"example_status","merge_fields":"example_merge_fields","tags":"example_tags"}' --json

mailchimp.mailchimp_get_subscriber

Read read

Retrieve a subscriber's details from a Mailchimp audience by their email address. Returns the subscriber's status, merge fields, tags, and activity timestamps.

Parameters
list_id, email

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_get_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_get_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json

mailchimp.mailchimp_update_subscriber

Write write

Update an existing subscriber's merge fields and/or status in a Mailchimp audience. Provide the subscriber's email address to identify the record. Returns the updated subscriber details.

Parameters
list_id, email, merge_fields, status

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_update_subscriber '{"list_id":"example_list_id","email":"example_email","merge_fields":"example_merge_fields","status":"example_status"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_update_subscriber '{"list_id":"example_list_id","email":"example_email","merge_fields":"example_merge_fields","status":"example_status"}' --json

mailchimp.mailchimp_search_subscribers

Read read

Search for subscribers by email address or name across all audiences or within a specific list. Returns matching subscriber records with their list membership and status.

Parameters
query, list_id, count

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_search_subscribers '{"query":"example_query","list_id":"example_list_id","count":1}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_search_subscribers '{"query":"example_query","list_id":"example_list_id","count":1}' --json

mailchimp.mailchimp_remove_subscriber

Write write

Remove (archive) a subscriber from a Mailchimp audience by their email address. This archives the member; it does not permanently delete it.

Parameters
list_id, email

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_remove_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_remove_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json

mailchimp.mailchimp_create_campaign

Write write

Create a new campaign in Mailchimp. Requires a campaign type and the target list_id. Optional settings include subject line, title, from name, and reply-to address. Returns the newly created campaign with its ID and web_id.

Parameters
type, list_id, settings_subject, settings_title, settings_from_name, settings_reply_to

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_create_campaign '{"type":"example_type","list_id":"example_list_id","settings_subject":"example_settings_subject","settings_title":"example_settings_title","settings_from_name":"example_settings_from_name","settings_reply_to":"example_settings_reply_to"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_create_campaign '{"type":"example_type","list_id":"example_list_id","settings_subject":"example_settings_subject","settings_title":"example_settings_title","settings_from_name":"example_settings_from_name","settings_reply_to":"example_settings_reply_to"}' --json

mailchimp.mailchimp_get_campaign

Read read

Get details for a single Mailchimp campaign by its ID. Returns the campaign type, status, settings, recipient list, and send times.

Parameters
id

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_get_campaign '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_get_campaign '{"id":"example_id"}' --json

mailchimp.mailchimp_update_campaign

Write write

Update a Mailchimp campaign's settings such as subject line, title, from name, or reply-to. Provide the campaign ID and a settings object with the fields to update. Returns the updated campaign details.

Parameters
id, settings

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_update_campaign '{"id":"example_id","settings":"example_settings"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_update_campaign '{"id":"example_id","settings":"example_settings"}' --json

mailchimp.mailchimp_send_campaign

Write write

Send a Mailchimp campaign immediately. The campaign must already have content configured and be in a "save" or "paused" state. This action is irreversible — once sent, the campaign cannot be recalled.

Parameters
id

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_send_campaign '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_send_campaign '{"id":"example_id"}' --json

mailchimp.mailchimp_list_campaigns

Read read

List campaigns in the Mailchimp account with offset-based pagination and optional filters. Filter by status (save, paused, schedule, sending, sent) or type (regular, plaintext, absplit, rss, variate). Returns each campaign's ID, title, status, and send time.

Parameters
count, offset, status, type

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_list_campaigns '{"count":1,"offset":1,"status":"example_status","type":"example_type"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_list_campaigns '{"count":1,"offset":1,"status":"example_status","type":"example_type"}' --json

mailchimp.mailchimp_tag_subscriber

Write write

Add or remove tags on a Mailchimp subscriber. Provide an array of tags, each with a name and status ("active" to add, "inactive" to remove).

Parameters
list_id, email, tags

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_tag_subscriber '{"list_id":"example_list_id","email":"example_email","tags":"example_tags"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_tag_subscriber '{"list_id":"example_list_id","email":"example_email","tags":"example_tags"}' --json

mailchimp.mailchimp_list_segments

Read read

List all segments (static and dynamic) for a Mailchimp audience. Returns each segment's ID, name, type, and member count.

Parameters
list_id, count

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_list_segments '{"list_id":"example_list_id","count":1}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_list_segments '{"list_id":"example_list_id","count":1}' --json

mailchimp.mailchimp_add_to_segment

Write write

Add a subscriber to a Mailchimp static segment by email address. The segment must be a static (not dynamic) segment. Returns the segment membership details.

Parameters
list_id, segment_id, email

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_add_to_segment '{"list_id":"example_list_id","segment_id":"example_segment_id","email":"example_email"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_add_to_segment '{"list_id":"example_list_id","segment_id":"example_segment_id","email":"example_email"}' --json

mailchimp.mailchimp_get_campaign_report

Read read

Get a detailed report for a sent Mailchimp campaign. Returns send stats (emails sent, bounces), open rates, click rates, and industry benchmarks.

Parameters
id

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_get_campaign_report '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_get_campaign_report '{"id":"example_id"}' --json

mailchimp.mailchimp_get_current_user

Read read

Get the authenticated Mailchimp user's account information. Returns account name, email, total subscribers, industry stats, and plan details. Useful for verifying the connection and understanding the account scope.

Parameters
none

Generic CLI call

kosmo integrations:call mailchimp.mailchimp_get_current_user '{}' --json

Provider shortcut

kosmo integrations:mailchimp mailchimp_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

mailchimp.mailchimp_list_audiences

List all audiences (lists) in the connected Mailchimp account. Returns each audience's ID, name, subscriber count, and other metadata. Supports offset-based pagination via the count and offset parameters.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_list_audiences --json
ParameterTypeRequiredDescription
count integer no Number of audiences to return (max 1000).
offset integer no Number of audiences to skip for pagination.

mailchimp.mailchimp_get_audience

Get full details for a single Mailchimp audience (list) by its ID. Returns the audience name, contact information, subscription stats, and default settings.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_audience --json
ParameterTypeRequiredDescription
id string yes The audience (list) ID.

mailchimp.mailchimp_create_audience

Create a new audience (list) in Mailchimp. Requires a name, contact information, permission reminder, and campaign defaults. Returns the newly created audience with its ID.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_create_audience --json
ParameterTypeRequiredDescription
name string yes The name of the audience.
contact object yes Contact information for the audience (company, address1, city, state, zip, country).
permission_reminder string yes Permission reminder text explaining why the subscriber is on this list.
email_type_option boolean no Whether to allow subscribers to choose HTML or plain-text email.
campaign_defaults object yes Default values for campaigns created from this audience.

mailchimp.mailchimp_add_subscriber

Add a new subscriber or update an existing one in a Mailchimp audience. Uses a PUT upsert based on the subscriber's email address (MD5 hash). Optionally set merge fields and initial tags. Returns the subscriber record with their ID and status.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_add_subscriber --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID to add the subscriber to.
email string yes The subscriber's email address.
status string no Subscription status: subscribed, unsubscribed, cleaned, or pending.
merge_fields object no Merge field values (e.g. {"FNAME": "John", "LNAME": "Doe"}).
tags array no Tag names to apply to the subscriber.

mailchimp.mailchimp_get_subscriber

Retrieve a subscriber's details from a Mailchimp audience by their email address. Returns the subscriber's status, merge fields, tags, and activity timestamps.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_subscriber --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID.
email string yes The subscriber's email address.

mailchimp.mailchimp_update_subscriber

Update an existing subscriber's merge fields and/or status in a Mailchimp audience. Provide the subscriber's email address to identify the record. Returns the updated subscriber details.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_update_subscriber --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID.
email string yes The subscriber's email address.
merge_fields object no Merge field values to update (e.g. {"FNAME": "Jane"}).
status string no New subscription status: subscribed, unsubscribed, cleaned, or pending.

mailchimp.mailchimp_search_subscribers

Search for subscribers by email address or name across all audiences or within a specific list. Returns matching subscriber records with their list membership and status.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_search_subscribers --json
ParameterTypeRequiredDescription
query string yes Search query — email address, name, or other subscriber data.
list_id string no Optional audience (list) ID to scope the search.
count integer no Number of results to return.

mailchimp.mailchimp_remove_subscriber

Remove (archive) a subscriber from a Mailchimp audience by their email address. This archives the member; it does not permanently delete it.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_remove_subscriber --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID.
email string yes The subscriber's email address.

mailchimp.mailchimp_create_campaign

Create a new campaign in Mailchimp. Requires a campaign type and the target list_id. Optional settings include subject line, title, from name, and reply-to address. Returns the newly created campaign with its ID and web_id.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_create_campaign --json
ParameterTypeRequiredDescription
type string yes Campaign type: regular, plaintext, absplit, rss, or variate.
list_id string yes The audience (list) ID to send the campaign to.
settings_subject string no The email subject line.
settings_title string no Internal campaign title (visible in Mailchimp dashboard only).
settings_from_name string no The "from" name for the email.
settings_reply_to string no The reply-to email address.

mailchimp.mailchimp_get_campaign

Get details for a single Mailchimp campaign by its ID. Returns the campaign type, status, settings, recipient list, and send times.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_campaign --json
ParameterTypeRequiredDescription
id string yes The campaign ID.

mailchimp.mailchimp_update_campaign

Update a Mailchimp campaign's settings such as subject line, title, from name, or reply-to. Provide the campaign ID and a settings object with the fields to update. Returns the updated campaign details.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_update_campaign --json
ParameterTypeRequiredDescription
id string yes The campaign ID.
settings object yes Campaign settings to update (e.g. subject_line, title, from_name, reply_to).

mailchimp.mailchimp_send_campaign

Send a Mailchimp campaign immediately. The campaign must already have content configured and be in a "save" or "paused" state. This action is irreversible — once sent, the campaign cannot be recalled.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_send_campaign --json
ParameterTypeRequiredDescription
id string yes The campaign ID to send.

mailchimp.mailchimp_list_campaigns

List campaigns in the Mailchimp account with offset-based pagination and optional filters. Filter by status (save, paused, schedule, sending, sent) or type (regular, plaintext, absplit, rss, variate). Returns each campaign's ID, title, status, and send time.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_list_campaigns --json
ParameterTypeRequiredDescription
count integer no Number of campaigns to return.
offset integer no Number of campaigns to skip for pagination.
status string no Filter by campaign status.
type string no Filter by campaign type.

mailchimp.mailchimp_tag_subscriber

Add or remove tags on a Mailchimp subscriber. Provide an array of tags, each with a name and status ("active" to add, "inactive" to remove).

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_tag_subscriber --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID.
email string yes The subscriber's email address.
tags array yes Array of tag objects, each with "name" and "status" ("active" or "inactive").

mailchimp.mailchimp_list_segments

List all segments (static and dynamic) for a Mailchimp audience. Returns each segment's ID, name, type, and member count.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_list_segments --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID.
count integer no Number of segments to return.

mailchimp.mailchimp_add_to_segment

Add a subscriber to a Mailchimp static segment by email address. The segment must be a static (not dynamic) segment. Returns the segment membership details.

Operation
Write write
Schema command
kosmo integrations:schema mailchimp.mailchimp_add_to_segment --json
ParameterTypeRequiredDescription
list_id string yes The audience (list) ID.
segment_id string yes The segment ID to add the subscriber to.
email string yes The subscriber's email address.

mailchimp.mailchimp_get_campaign_report

Get a detailed report for a sent Mailchimp campaign. Returns send stats (emails sent, bounces), open rates, click rates, and industry benchmarks.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_campaign_report --json
ParameterTypeRequiredDescription
id string yes The campaign ID.

mailchimp.mailchimp_get_current_user

Get the authenticated Mailchimp user's account information. Returns account name, email, total subscribers, industry stats, and plan details. Useful for verifying the connection and understanding the account scope.

Operation
Read read
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.