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.

Mailchimp CLI Setup

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

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

No credentials are required.

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

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

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

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.

Read read
Parameters
count, offset
Generic call
kosmo integrations:call mailchimp.mailchimp_list_audiences '{"count":1,"offset":1}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_list_audiences '{"count":1,"offset":1}' --json

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.

Read read
Parameters
id
Generic call
kosmo integrations:call mailchimp.mailchimp_get_audience '{"id":"example_id"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_get_audience '{"id":"example_id"}' --json

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.

Write write
Parameters
name, contact, permission_reminder, email_type_option, campaign_defaults
Generic 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
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

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.

Write write
Parameters
list_id, email, status, merge_fields, tags
Generic 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
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

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

Read read
Parameters
list_id, email
Generic call
kosmo integrations:call mailchimp.mailchimp_get_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_get_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json

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.

Write write
Parameters
list_id, email, merge_fields, status
Generic 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
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

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.

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

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.

Write write
Parameters
list_id, email
Generic call
kosmo integrations:call mailchimp.mailchimp_remove_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_remove_subscriber '{"list_id":"example_list_id","email":"example_email"}' --json

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.

Write write
Parameters
type, list_id, settings_subject, settings_title, settings_from_name, settings_reply_to
Generic 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
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

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

Read read
Parameters
id
Generic call
kosmo integrations:call mailchimp.mailchimp_get_campaign '{"id":"example_id"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_get_campaign '{"id":"example_id"}' --json

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.

Write write
Parameters
id, settings
Generic call
kosmo integrations:call mailchimp.mailchimp_update_campaign '{"id":"example_id","settings":"example_settings"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_update_campaign '{"id":"example_id","settings":"example_settings"}' --json

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.

Write write
Parameters
id
Generic call
kosmo integrations:call mailchimp.mailchimp_send_campaign '{"id":"example_id"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_send_campaign '{"id":"example_id"}' --json

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.

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

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).

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

mailchimp.mailchimp_list_segments

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

Read read
Parameters
list_id, count
Generic call
kosmo integrations:call mailchimp.mailchimp_list_segments '{"list_id":"example_list_id","count":1}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_list_segments '{"list_id":"example_list_id","count":1}' --json

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.

Write write
Parameters
list_id, segment_id, email
Generic call
kosmo integrations:call mailchimp.mailchimp_add_to_segment '{"list_id":"example_list_id","segment_id":"example_segment_id","email":"example_email"}' --json
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

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

Read read
Parameters
id
Generic call
kosmo integrations:call mailchimp.mailchimp_get_campaign_report '{"id":"example_id"}' --json
Shortcut
kosmo integrations:mailchimp mailchimp_get_campaign_report '{"id":"example_id"}' --json

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.

Read read
Parameters
none
Generic call
kosmo integrations:call mailchimp.mailchimp_get_current_user '{}' --json
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 2 parameters
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 1 parameters
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_audience --json
ParameterTypeRequiredDescription
id string yes The audience (list) ID.
mailchimp.mailchimp_create_audience 5 parameters
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 5 parameters
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 2 parameters
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 4 parameters
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 3 parameters
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 2 parameters
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 6 parameters
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 1 parameters
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_campaign --json
ParameterTypeRequiredDescription
id string yes The campaign ID.
mailchimp.mailchimp_update_campaign 2 parameters
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 1 parameters
Schema command
kosmo integrations:schema mailchimp.mailchimp_send_campaign --json
ParameterTypeRequiredDescription
id string yes The campaign ID to send.
mailchimp.mailchimp_list_campaigns 4 parameters
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 3 parameters
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 2 parameters
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 3 parameters
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 1 parameters
Schema command
kosmo integrations:schema mailchimp.mailchimp_get_campaign_report --json
ParameterTypeRequiredDescription
id string yes The campaign ID.
mailchimp.mailchimp_get_current_user 0 parameters
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.