KosmoKrator

email

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.

6 functions 4 read 2 write API key auth

Elastic Email CLI Setup

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

# 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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

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

Call Elastic Email Headlessly

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

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

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

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

Agent Discovery Commands

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

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

elastic-email.elasticemail_send_email

Write write

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

Parameters
to, subject, body, from, from_name, reply_to, cc, bcc

Generic CLI 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

Provider 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_list_templates

Read read

List email templates available in your Elastic Email account.

Parameters
limit, offset

Generic CLI call

kosmo integrations:call elastic-email.elasticemail_list_templates '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:elastic-email elasticemail_list_templates '{"limit":1,"offset":1}' --json

elastic-email.elasticemail_get_template

Read read

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

Parameters
id

Generic CLI call

kosmo integrations:call elastic-email.elasticemail_get_template '{"id":1}' --json

Provider shortcut

kosmo integrations:elastic-email elasticemail_get_template '{"id":1}' --json

elastic-email.elasticemail_list_contacts

Read read

List contacts from your Elastic Email account.

Parameters
limit, offset

Generic CLI call

kosmo integrations:call elastic-email.elasticemail_list_contacts '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:elastic-email elasticemail_list_contacts '{"limit":1,"offset":1}' --json

elastic-email.elasticemail_create_contact

Write write

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

Parameters
email, list_name, first_name, last_name

Generic CLI 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

Provider 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_get_current_user

Read read

Get information about the currently authenticated Elastic Email user account.

Parameters
none

Generic CLI call

kosmo integrations:call elastic-email.elasticemail_get_current_user '{}' --json

Provider shortcut

kosmo integrations:elastic-email elasticemail_get_current_user '{}' --json

Function Schemas

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

elastic-email.elasticemail_send_email

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

Operation
Write write
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_list_templates

List email templates available in your Elastic Email account.

Operation
Read read
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_get_template

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

Operation
Read read
Schema command
kosmo integrations:schema elastic-email.elasticemail_get_template --json
ParameterTypeRequiredDescription
id integer yes The template ID.

elastic-email.elasticemail_list_contacts

List contacts from your Elastic Email account.

Operation
Read read
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_create_contact

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

Operation
Write write
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_get_current_user

Get information about the currently authenticated Elastic Email user account.

Operation
Read read
Schema command
kosmo integrations:schema elastic-email.elasticemail_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.