KosmoKrator

productivity

Elastic Email CLI for AI Agents

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

Elastic Email CLI Setup

Elastic Email can be configured headlessly with `kosmokrator integrations:configure elastic-email`.

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 elastic-email --set api_key="$ELASTIC_EMAIL_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor elastic-email --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.

KeyEnv varTypeRequiredLabel
api_key ELASTIC_EMAIL_API_KEY Secret secret yes API Key
url ELASTIC_EMAIL_URL URL url no API Base URL

Command Patterns

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

Generic CLI call
kosmo integrations:call elastic-email.elasticemail_add_contacts_to_list '{"name":"example_name","emails":"example_emails"}' --json
Provider shortcut
kosmo integrations:elastic-email elasticemail_add_contacts_to_list '{"name":"example_name","emails":"example_emails"}' --json

Discovery

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

Discovery commands
kosmo integrations:docs elastic-email --json
kosmo integrations:docs elastic-email.elasticemail_add_contacts_to_list --json
kosmo integrations:schema elastic-email.elasticemail_add_contacts_to_list --json
kosmo integrations:search "Elastic Email" --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.

elastic-email.elasticemail_add_contacts_to_list

Add one or more contacts to an Elastic Email list.

Write write
Parameters
name, emails
Generic call
kosmo integrations:call elastic-email.elasticemail_add_contacts_to_list '{"name":"example_name","emails":"example_emails"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_add_contacts_to_list '{"name":"example_name","emails":"example_emails"}' --json

elastic-email.elasticemail_api_get

Call any Elastic Email API v4 GET endpoint not covered by a first-class tool.

Read read
Parameters
path, params
Generic call
kosmo integrations:call elastic-email.elasticemail_api_get '{"path":"example_path","params":"example_params"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_api_get '{"path":"example_path","params":"example_params"}' --json

elastic-email.elasticemail_api_post

Call an Elastic Email API v4 POST endpoint with a JSON payload.

Read read
Parameters
path, payload
Generic call
kosmo integrations:call elastic-email.elasticemail_api_post '{"path":"example_path","payload":"example_payload"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_api_post '{"path":"example_path","payload":"example_payload"}' --json

elastic-email.elasticemail_create_contact

Create or add a contact in Elastic Email. Optionally assign the contact to an existing list.

Write write
Parameters
email, list_name, first_name, last_name
Generic call
kosmo integrations:call elastic-email.elasticemail_create_contact '{"email":"example_email","list_name":"example_list_name","first_name":"example_first_name","last_name":"example_last_name"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_create_contact '{"email":"example_email","list_name":"example_list_name","first_name":"example_first_name","last_name":"example_last_name"}' --json

elastic-email.elasticemail_delete_contact

Delete an Elastic Email contact by email address.

Write write
Parameters
email
Generic call
kosmo integrations:call elastic-email.elasticemail_delete_contact '{"email":"example_email"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_delete_contact '{"email":"example_email"}' --json

elastic-email.elasticemail_get_campaign

Get an Elastic Email campaign by name.

Read read
Parameters
name
Generic call
kosmo integrations:call elastic-email.elasticemail_get_campaign '{"name":"example_name"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_campaign '{"name":"example_name"}' --json

elastic-email.elasticemail_get_campaign_statistics

Get statistics for an Elastic Email campaign by name.

Read read
Parameters
name
Generic call
kosmo integrations:call elastic-email.elasticemail_get_campaign_statistics '{"name":"example_name"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_campaign_statistics '{"name":"example_name"}' --json

elastic-email.elasticemail_get_contact

Load a single Elastic Email contact by email address.

Read read
Parameters
email
Generic call
kosmo integrations:call elastic-email.elasticemail_get_contact '{"email":"example_email"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_contact '{"email":"example_email"}' --json

elastic-email.elasticemail_get_email_status

Get delivery status for an Elastic Email transaction ID.

Read read
Parameters
transaction_id
Generic call
kosmo integrations:call elastic-email.elasticemail_get_email_status '{"transaction_id":"example_transaction_id"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_email_status '{"transaction_id":"example_transaction_id"}' --json

elastic-email.elasticemail_get_list

Load an Elastic Email contact list by name.

Read read
Parameters
name
Generic call
kosmo integrations:call elastic-email.elasticemail_get_list '{"name":"example_name"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_list '{"name":"example_name"}' --json

elastic-email.elasticemail_get_statistics

Get account-wide Elastic Email statistics.

Read read
Parameters
params
Generic call
kosmo integrations:call elastic-email.elasticemail_get_statistics '{"params":"example_params"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_statistics '{"params":"example_params"}' --json

elastic-email.elasticemail_get_template

Get details of a specific email template by name from Elastic Email.

Read read
Parameters
id
Generic call
kosmo integrations:call elastic-email.elasticemail_get_template '{"id":"example_id"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_get_template '{"id":"example_id"}' --json

elastic-email.elasticemail_list_campaigns

List Elastic Email campaigns.

Read read
Parameters
params
Generic call
kosmo integrations:call elastic-email.elasticemail_list_campaigns '{"params":"example_params"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_campaigns '{"params":"example_params"}' --json

elastic-email.elasticemail_list_contacts

List contacts from your Elastic Email account.

Read read
Parameters
limit, offset
Generic call
kosmo integrations:call elastic-email.elasticemail_list_contacts '{"limit":1,"offset":1}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_contacts '{"limit":1,"offset":1}' --json

elastic-email.elasticemail_list_email_events

List events for a single Elastic Email transaction ID.

Read read
Parameters
transaction_id
Generic call
kosmo integrations:call elastic-email.elasticemail_list_email_events '{"transaction_id":"example_transaction_id"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_email_events '{"transaction_id":"example_transaction_id"}' --json

elastic-email.elasticemail_list_events

List Elastic Email events with optional filters.

Read read
Parameters
params
Generic call
kosmo integrations:call elastic-email.elasticemail_list_events '{"params":"example_params"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_events '{"params":"example_params"}' --json

elastic-email.elasticemail_list_files

List files uploaded to Elastic Email.

Read read
Parameters
none
Generic call
kosmo integrations:call elastic-email.elasticemail_list_files '{}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_files '{}' --json

elastic-email.elasticemail_list_list_contacts

List contacts in an Elastic Email contact list.

Read read
Parameters
name, params
Generic call
kosmo integrations:call elastic-email.elasticemail_list_list_contacts '{"name":"example_name","params":"example_params"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_list_contacts '{"name":"example_name","params":"example_params"}' --json

elastic-email.elasticemail_list_lists

List Elastic Email contact lists.

Read read
Parameters
params
Generic call
kosmo integrations:call elastic-email.elasticemail_list_lists '{"params":"example_params"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_lists '{"params":"example_params"}' --json

elastic-email.elasticemail_list_suppressions

List unsubscribes, bounces, or complaints from Elastic Email suppressions.

Read read
Parameters
type
Generic call
kosmo integrations:call elastic-email.elasticemail_list_suppressions '{"type":"example_type"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_suppressions '{"type":"example_type"}' --json

elastic-email.elasticemail_list_templates

List email templates available in your Elastic Email account.

Read read
Parameters
limit, offset
Generic call
kosmo integrations:call elastic-email.elasticemail_list_templates '{"limit":1,"offset":1}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_list_templates '{"limit":1,"offset":1}' --json

elastic-email.elasticemail_pause_campaign

Pause an Elastic Email campaign by name.

Write write
Parameters
name
Generic call
kosmo integrations:call elastic-email.elasticemail_pause_campaign '{"name":"example_name"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_pause_campaign '{"name":"example_name"}' --json

elastic-email.elasticemail_remove_contacts_from_list

Remove one or more contacts from an Elastic Email list.

Write write
Parameters
name, emails
Generic call
kosmo integrations:call elastic-email.elasticemail_remove_contacts_from_list '{"name":"example_name","emails":"example_emails"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_remove_contacts_from_list '{"name":"example_name","emails":"example_emails"}' --json

elastic-email.elasticemail_send_bulk_email

Send a bulk email using the Elastic Email /emails endpoint with a full v4 payload.

Write write
Parameters
payload
Generic call
kosmo integrations:call elastic-email.elasticemail_send_bulk_email '{"payload":"example_payload"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_send_bulk_email '{"payload":"example_payload"}' --json

elastic-email.elasticemail_send_email

Send a transactional email via Elastic Email. Provide the recipient address, subject, and HTML body.

Write write
Parameters
to, subject, body, from, from_name, reply_to, cc, bcc
Generic call
kosmo integrations:call elastic-email.elasticemail_send_email '{"to":"example_to","subject":"example_subject","body":"example_body","from":"example_from","from_name":"example_from_name","reply_to":"example_reply_to","cc":"example_cc","bcc":"example_bcc"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_send_email '{"to":"example_to","subject":"example_subject","body":"example_body","from":"example_from","from_name":"example_from_name","reply_to":"example_reply_to","cc":"example_cc","bcc":"example_bcc"}' --json

elastic-email.elasticemail_update_contact

Update an Elastic Email contact by email address.

Write write
Parameters
email, payload
Generic call
kosmo integrations:call elastic-email.elasticemail_update_contact '{"email":"example_email","payload":"example_payload"}' --json
Shortcut
kosmo integrations:elastic-email elasticemail_update_contact '{"email":"example_email","payload":"example_payload"}' --json

Function Schemas

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

elastic-email.elasticemail_add_contacts_to_list 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_add_contacts_to_list --json
ParameterTypeRequiredDescription
name string yes List name.
emails string yes Comma- or semicolon-separated email addresses.
elastic-email.elasticemail_api_get 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_api_get --json
ParameterTypeRequiredDescription
path string yes API path such as /domains or /security/apikeys.
params object no Query parameters.
elastic-email.elasticemail_api_post 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_api_post --json
ParameterTypeRequiredDescription
path string yes API path such as /contacts/export.
payload object no JSON request payload.
elastic-email.elasticemail_create_contact 4 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_create_contact --json
ParameterTypeRequiredDescription
email string yes Contact email address.
list_name string no Name of the list to add the contact to. The list must already exist in your Elastic Email account.
first_name string no Contact first name.
last_name string no Contact last name.
elastic-email.elasticemail_delete_contact 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_delete_contact --json
ParameterTypeRequiredDescription
email string yes Contact email address.
elastic-email.elasticemail_get_campaign 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_campaign --json
ParameterTypeRequiredDescription
name string yes Campaign name.
elastic-email.elasticemail_get_campaign_statistics 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_campaign_statistics --json
ParameterTypeRequiredDescription
name string yes Campaign name.
elastic-email.elasticemail_get_contact 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_contact --json
ParameterTypeRequiredDescription
email string yes Contact email address.
elastic-email.elasticemail_get_email_status 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_email_status --json
ParameterTypeRequiredDescription
transaction_id string yes Transaction ID returned by send email.
elastic-email.elasticemail_get_list 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_list --json
ParameterTypeRequiredDescription
name string yes List name.
elastic-email.elasticemail_get_statistics 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_statistics --json
ParameterTypeRequiredDescription
params object no Optional from and to dates.
elastic-email.elasticemail_get_template 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_template --json
ParameterTypeRequiredDescription
id string yes The template name.
elastic-email.elasticemail_list_campaigns 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_campaigns --json
ParameterTypeRequiredDescription
params object no Optional limit and offset.
elastic-email.elasticemail_list_contacts 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_contacts --json
ParameterTypeRequiredDescription
limit integer no Maximum number of contacts to return (default: 100).
offset integer no Offset for pagination (default: 0).
elastic-email.elasticemail_list_email_events 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_email_events --json
ParameterTypeRequiredDescription
transaction_id string yes Transaction ID.
elastic-email.elasticemail_list_events 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_events --json
ParameterTypeRequiredDescription
params object no Optional from, to, eventTypes, limit, offset, channelName.
elastic-email.elasticemail_list_files 0 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_files --json
ParameterTypeRequiredDescription
No parameters.
elastic-email.elasticemail_list_list_contacts 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_list_contacts --json
ParameterTypeRequiredDescription
name string yes List name.
params object no Optional limit and offset.
elastic-email.elasticemail_list_lists 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_lists --json
ParameterTypeRequiredDescription
params object no Optional limit and offset.
elastic-email.elasticemail_list_suppressions 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_suppressions --json
ParameterTypeRequiredDescription
type string no unsubscribes, bounces, or complaints. Default: unsubscribes.
elastic-email.elasticemail_list_templates 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_list_templates --json
ParameterTypeRequiredDescription
limit integer no Maximum number of templates to return (default: 100).
offset integer no Offset for pagination (default: 0).
elastic-email.elasticemail_pause_campaign 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_pause_campaign --json
ParameterTypeRequiredDescription
name string yes Campaign name.
elastic-email.elasticemail_remove_contacts_from_list 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_remove_contacts_from_list --json
ParameterTypeRequiredDescription
name string yes List name.
emails string yes Comma- or semicolon-separated email addresses.
elastic-email.elasticemail_send_bulk_email 1 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_send_bulk_email --json
ParameterTypeRequiredDescription
payload object yes Elastic Email EmailMessageData payload.
elastic-email.elasticemail_send_email 8 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_send_email --json
ParameterTypeRequiredDescription
to string yes Recipient email address. For multiple recipients, separate with semicolons.
subject string yes Email subject line.
body string yes HTML body content of the email.
from string no Sender email address (must be a verified sender in your Elastic Email account).
from_name string no Display name for the sender.
reply_to string no Reply-to email address.
cc string no CC recipients, separated by semicolons.
bcc string no BCC recipients, separated by semicolons.
elastic-email.elasticemail_update_contact 2 parameters
Schema command
kosmo integrations:schema elastic-email.elasticemail_update_contact --json
ParameterTypeRequiredDescription
email string yes Contact email address.
payload object yes Contact payload fields to update.

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.