productivity
Mautic CLI for AI Agents
Use the Mautic CLI from KosmoKrator to call Mautic tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Mautic CLI Setup
Mautic can be configured headlessly with `kosmokrator integrations:configure mautic`.
# 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 mautic --set hostname="$MAUTIC_HOSTNAME" --set username="$MAUTIC_USERNAME" --set password="$MAUTIC_PASSWORD" --enable --read allow --write ask --json
kosmokrator integrations:doctor mautic --json
kosmokrator integrations:status --json Credentials
Authentication type: Username and password basic. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
hostname | MAUTIC_HOSTNAME | URL url | yes | Mautic URL |
username | MAUTIC_USERNAME | Text text | yes | Username |
password | MAUTIC_PASSWORD | Secret secret | yes | Password |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call mautic.mautic_list_contacts '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json kosmo integrations:mautic mautic_list_contacts '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs mautic --json
kosmo integrations:docs mautic.mautic_list_contacts --json
kosmo integrations:schema mautic.mautic_list_contacts --json
kosmo integrations:search "Mautic" --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.
mautic.mautic_list_contacts
List contacts in Mautic. Supports search, filtering, pagination, and ordering. Returns contact details including email, name, and custom fields.
read - Parameters
- search, limit, start, orderBy, orderByDir
kosmo integrations:call mautic.mautic_list_contacts '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json kosmo integrations:mautic mautic_list_contacts '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json mautic.mautic_get_contact
Get detailed information about a single Mautic contact by ID, including all fields and tags.
read - Parameters
- id
kosmo integrations:call mautic.mautic_get_contact '{"id":1}' --json kosmo integrations:mautic mautic_get_contact '{"id":1}' --json mautic.mautic_create_contact
Create a new contact in Mautic. Provide at least an email address; additional fields like first name, last name, phone, company, and tags are optional.
write - Parameters
- email, firstname, lastname, phone, company, position, tags, owner
kosmo integrations:call mautic.mautic_create_contact '{"email":"example_email","firstname":"example_firstname","lastname":"example_lastname","phone":"example_phone","company":"example_company","position":"example_position","tags":"example_tags","owner":1}' --json kosmo integrations:mautic mautic_create_contact '{"email":"example_email","firstname":"example_firstname","lastname":"example_lastname","phone":"example_phone","company":"example_company","position":"example_position","tags":"example_tags","owner":1}' --json mautic.mautic_update_contact
Update an existing Mautic contact. Provide the contact ID and the fields to update (e.g. email, firstname, lastname, phone, company, tags).
write - Parameters
- id, email, firstname, lastname, phone, company, position, tags, owner
kosmo integrations:call mautic.mautic_update_contact '{"id":1,"email":"example_email","firstname":"example_firstname","lastname":"example_lastname","phone":"example_phone","company":"example_company","position":"example_position","tags":"example_tags"}' --json kosmo integrations:mautic mautic_update_contact '{"id":1,"email":"example_email","firstname":"example_firstname","lastname":"example_lastname","phone":"example_phone","company":"example_company","position":"example_position","tags":"example_tags"}' --json mautic.mautic_delete_contact
Delete a contact from Mautic by ID. This action is permanent and cannot be undone.
write - Parameters
- id
kosmo integrations:call mautic.mautic_delete_contact '{"id":1}' --json kosmo integrations:mautic mautic_delete_contact '{"id":1}' --json mautic.mautic_list_emails
List marketing emails from Mautic. Returns email details including name, subject, and publish status.
read - Parameters
- search, limit, start, orderBy, orderByDir
kosmo integrations:call mautic.mautic_list_emails '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json kosmo integrations:mautic mautic_list_emails '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json mautic.mautic_list_segments
List contact segments (also known as lists or filters) from Mautic. Returns segment names, aliases, and contact counts.
read - Parameters
- search, limit, start, orderBy, orderByDir
kosmo integrations:call mautic.mautic_list_segments '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json kosmo integrations:mautic mautic_list_segments '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json mautic.mautic_list_forms
List forms from Mautic. Returns form names, aliases, submission counts, and publish status.
read - Parameters
- search, limit, start, orderBy, orderByDir
kosmo integrations:call mautic.mautic_list_forms '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json kosmo integrations:mautic mautic_list_forms '{"search":"example_search","limit":1,"start":1,"orderBy":"example_orderBy","orderByDir":"example_orderByDir"}' --json mautic.mautic_get_current_user
Get details of the currently authenticated Mautic user — useful to verify credentials and identify which user the integration is acting as.
read - Parameters
- none
kosmo integrations:call mautic.mautic_get_current_user '{}' --json kosmo integrations:mautic mautic_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
mautic.mautic_list_contacts 5 parameters
kosmo integrations:schema mautic.mautic_list_contacts --json | Parameter | Type | Required | Description |
|---|---|---|---|
search | string | no | Search query to filter contacts (e.g. "email:john@example.com" or a name). |
limit | integer | no | Maximum number of contacts to return (default: 30, max: 100). |
start | integer | no | Offset for pagination (default: 0). |
orderBy | string | no | Field to order by (e.g. "email", "firstName", "lastName", "id"). |
orderByDir | string | no | Order direction: "asc" or "desc" (default: "asc"). |
mautic.mautic_get_contact 1 parameters
kosmo integrations:schema mautic.mautic_get_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Mautic contact ID. |
mautic.mautic_create_contact 8 parameters
kosmo integrations:schema mautic.mautic_create_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
email | string | yes | Email address for the contact. |
firstname | string | no | First name. |
lastname | string | no | Last name. |
phone | string | no | Phone number. |
company | string | no | Company name. |
position | string | no | Job title / position. |
tags | array | no | Tags to assign (array of tag names, e.g. ["lead", "newsletter"]). |
owner | integer | no | User ID of the contact owner. |
mautic.mautic_update_contact 9 parameters
kosmo integrations:schema mautic.mautic_update_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Mautic contact ID to update. |
email | string | no | Updated email address. |
firstname | string | no | Updated first name. |
lastname | string | no | Updated last name. |
phone | string | no | Updated phone number. |
company | string | no | Updated company name. |
position | string | no | Updated job title / position. |
tags | array | no | Tags to set (array of tag names, e.g. ["lead", "newsletter"]). |
owner | integer | no | User ID of the contact owner. |
mautic.mautic_delete_contact 1 parameters
kosmo integrations:schema mautic.mautic_delete_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Mautic contact ID to delete. |
mautic.mautic_list_emails 5 parameters
kosmo integrations:schema mautic.mautic_list_emails --json | Parameter | Type | Required | Description |
|---|---|---|---|
search | string | no | Search query to filter emails. |
limit | integer | no | Maximum number of emails to return (default: 30). |
start | integer | no | Offset for pagination (default: 0). |
orderBy | string | no | Field to order by (e.g. "subject", "id"). |
orderByDir | string | no | Order direction: "asc" or "desc". |
mautic.mautic_list_segments 5 parameters
kosmo integrations:schema mautic.mautic_list_segments --json | Parameter | Type | Required | Description |
|---|---|---|---|
search | string | no | Search query to filter segments. |
limit | integer | no | Maximum number of segments to return (default: 30). |
start | integer | no | Offset for pagination (default: 0). |
orderBy | string | no | Field to order by (e.g. "name", "id"). |
orderByDir | string | no | Order direction: "asc" or "desc". |
mautic.mautic_list_forms 5 parameters
kosmo integrations:schema mautic.mautic_list_forms --json | Parameter | Type | Required | Description |
|---|---|---|---|
search | string | no | Search query to filter forms. |
limit | integer | no | Maximum number of forms to return (default: 30). |
start | integer | no | Offset for pagination (default: 0). |
orderBy | string | no | Field to order by (e.g. "name", "id"). |
orderByDir | string | no | Order direction: "asc" or "desc". |
mautic.mautic_get_current_user 0 parameters
kosmo integrations:schema mautic.mautic_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.