Mailerlite

Learn how to use Mailerlite with Composio

Overview

SLUG: MAILERLITE

Description

MailerLite is an email marketing service that offers tools for creating and managing email campaigns, automating workflows, and building landing pages.

Authentication Details

generic_api_key
stringRequired

Connecting to Mailerlite

Create an auth config

Use the dashboard to create an auth config for the Mailerlite toolkit. This allows you to connect multiple Mailerlite accounts to Composio for agents to use.

1

Select App

Navigate to the Mailerlite toolkit page and click “Setup Integration”.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Integration”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2from composio.types import auth_scheme
3
4# Replace these with your actual values
5mailerlite_auth_config_id = "ac_YOUR_MAILERLITE_CONFIG_ID" # Auth config ID created above
6user_id = "0000-0000-0000" # UUID from database/app
7
8composio = Composio()
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 # Replace this with a method to retrieve an API key from the user.
12 # Or supply your own.
13 user_api_key = input("[!] Enter API key")
14
15 connection_request = composio.connected_accounts.initiate(
16 user_id=user_id,
17 auth_config_id=auth_config_id,
18 config={"auth_scheme": "API_KEY", "val": user_api_key}
19 )
20
21 # API Key authentication is immediate - no redirect needed
22 print(f"Successfully connected Mailerlite for user {user_id}")
23 print(f"Connection status: {connection_request.status}")
24
25 return connection_request.id
26
27
28connection_id = authenticate_toolkit(user_id, mailerlite_auth_config_id)
29
30# You can verify the connection using:
31connected_account = composio.connected_accounts.get(connection_id)
32print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Mailerlite toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["MAILERLITE"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create/Update E-commerce Customer

Description

Tool to create or update a customer record for a shop. use when syncing shop customers or onboarding new purchases.

Action Parameters

accepts_marketing
boolean
create_subscriber
boolean
email
Required
shop_id
stringRequired
total_spent
number

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create E-commerce Shop

Description

Tool to connect a new e-commerce shop. use when you need to integrate a store for automations, product imports, and sales tracking.

Action Parameters

access_data
string
currency
Required
enable_popups
boolean
enabled
boolean
group_id
integer
name
stringRequired
platform
string
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Field

Description

Tool to create a new custom field. use when distinct subscriber attributes are needed before assigning or updating subscriber data. call once per field key.

Action Parameters

name
stringRequired
type
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Group

Description

Tool to create a new subscriber group. use after deciding the group name for categorization.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Segment

Description

Tool to create a new subscriber segment. use when grouping subscribers by custom criteria before sending targeted campaigns.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Webhook

Description

Tool to register a new webhook url for specified event types. use when you need real-time notifications for selected mailerlite events.

Action Parameters

batchable
boolean
enabled
boolean
events
arrayRequired
name
string
url
Required

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Automation

Description

Tool to delete an automation workflow by id. use when you need to remove an automation after confirming it's no longer needed. returns success=true on 204 no content.

Action Parameters

automation_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete E-commerce Customer

Description

Tool to delete a customer from an e-commerce shop by ids. use when you need to remove a specific customer from your mailerlite store.

Action Parameters

customer_id
stringRequired
shop_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete E-commerce Shop

Description

Tool to disconnect an e-commerce shop by id. use when you have the shop's unique identifier and want to remove it from your mailerlite account.

Action Parameters

shop_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Field

Description

Tool to delete a custom field. use when a field is obsolete and you need to remove it from your mailerlite account. returns success=true on 204 no content.

Action Parameters

field_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Group

Description

Tool to delete a subscriber group by id. use when you need to remove an existing subscriber group from your mailerlite account. returns success=true on 204 no content.

Action Parameters

group_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Segment

Description

Tool to delete a segment by id. use when you need to remove an existing segment from your mailerlite account. returns success=true on 204 no content.

Action Parameters

segment_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Subscriber

Description

Tool to delete a subscriber by id. use when you have the subscriber id and want to remove them from your mailerlite account. returns success=true on 204 no content.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Webhook

Description

Tool to remove a webhook subscription by id. use when you need to delete a webhook after confirming it is no longer needed. returns success=true on 204 no content.

Action Parameters

webhook_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch Total E-commerce Customers Count

Description

Tool to fetch total ecommerce customers count for a shop. use when only the aggregate count is required without retrieving detailed records.

Action Parameters

shop_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Account Info

Description

Tool to retrieve basic mailerlite account details. use when you need to verify authentication and review account metadata.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Account Stats

Description

Tool to retrieve usage statistics and performance metrics for the account. use after sending campaigns to analyze engagement and deliverability.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Automation

Description

Tool to retrieve details of a specific automation by id. use when you have the automation id and need its full configuration. example: "get automation 7267552".

Action Parameters

automation_id
stringRequired
fields
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Campaigns

Description

Tool to retrieve a list of all campaigns. use when you need to fetch campaigns optionally filtered by status or type, with pagination.

Action Parameters

filter[status]
string
filter[type]
string
limit
integer
page
integer

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get E-commerce Customer

Description

Tool to fetch details of a customer by shop and customer id. use after confirming shop id and customer id.

Action Parameters

customer_id
integerRequired
shop_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get E-commerce Customers

Description

Tool to list customers for a specific shop. use when you need to retrieve and paginate ecommerce customers after you have a shop id. example: "list customers for shop 123".

Action Parameters

limit
integer
page
integer
shop_id
stringRequired

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get E-commerce Shop

Description

Tool to fetch details of a specific e-commerce shop by id. use when you need detailed configuration or stats of a connected shop.

Action Parameters

shop_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get E-commerce Shops

Description

Tool to list all e-commerce shops connected to the account. use when you need to retrieve and paginate shop listings for an account.

Action Parameters

limit
integer
page
integer

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get Fields

Description

Tool to retrieve all custom fields defined in the account. use when you need to list or paginate through subscriber custom fields.

Action Parameters

filter[keyword]
string
filter[type]
string
limit
integer
page
integer
sort
string

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get Groups

Description

Tool to retrieve all subscriber groups. use when you need to list or paginate through subscriber groups.

Action Parameters

filter[name]
string
limit
integer
page
integer
sort
string

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get Group Subscribers

Description

Tool to list subscribers within a group by id. use when you need to retrieve subscribers belonging to a specific mailerlite group before targeted campaigns. use after confirming the group id is valid.

Action Parameters

cursor
string
filter[status]
string
group_id
stringRequired
include
string
limit
integer

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get Segments

Description

Tool to retrieve all segments in the account. use when you need to list or paginate through segments.

Action Parameters

limit
integer
page
integer

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get Subscribers

Description

Tool to retrieve all subscribers. use after connecting account and when listing subscribers by status or paginating. limited by mailerlite connect api quotas.

Action Parameters

cursor
string
filter[status]
string
include
string
limit
integer

Action Response

data
arrayRequired
error
string
links
objectRequired
meta
objectRequired
successful
booleanRequired

Tool Name: Get Webhooks

Description

Tool to retrieve all configured webhooks. use when you need to list webhooks for your mailerlite account.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: Set Double Opt-In

Description

Tool to enable or disable double opt-in for new subscribers. use when configuring subscription confirmation settings.

Action Parameters

double_opt_in
booleanRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update E-commerce Customer

Description

Tool to update a customer's data for a shop by ids. use when you need to change email, marketing opt-in, or spend totals for an existing customer.

Action Parameters

accepts_marketing
boolean
create_subscriber
boolean
customer_id
stringRequired
email
stringRequired
shop_id
stringRequired
total_spent
number

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update E-commerce Shop

Description

Tool to update settings of a connected e-commerce shop by id. use when you need to modify shop details (name, url, currency) or toggle features after verifying the shop exists.

Action Parameters

access_data
string
currency
Required
enable_popups
boolean
enabled
boolean
group_id
integer
name
stringRequired
platform
string
shop_id
stringRequired
url
Required

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Field

Description

Tool to update the title of an existing custom field. use when renaming a field label (e.g., correct typos or rebranding).

Action Parameters

field_id
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Group

Description

Tool to update a group's name by id. use when renaming an existing group after confirming its id.

Action Parameters

id
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Segment

Description

Tool to rename an existing segment by id. use when you need to update a segment's name after confirming its id.

Action Parameters

id
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Subscriber

Description

Tool to update an existing subscriber's information by id. use when altering subscriber details.

Action Parameters

fields
object
groups
array
id
stringRequired
ip_address
string
opted_in_at
string
optin_ip
string
status
string
subscribed_at
string
unsubscribed_at
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Webhook

Description

Tool to update an existing mailerlite webhook. use when you need to change its url or event triggers by id.

Action Parameters

batchable
boolean
enabled
boolean
events
arrayRequired
name
string
url
Required
webhook_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create automation

Description

Create automation

Action Parameters

is_active
boolean
name
stringRequired
trigger
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired