MailerLite
name: mailerlite
by byungkyu · published 2026-03-22
$ claw add gh:byungkyu/byungkyu-mailerlite---
name: mailerlite
description: |
MailerLite API integration with managed OAuth. Manage email subscribers, groups, campaigns, automations, and forms.
Use this skill when users want to add subscribers, create email campaigns, manage groups, or work with MailerLite automations.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
compatibility: Requires network access and valid Maton API key
metadata:
author: maton
version: "1.0"
clawdbot:
emoji: 🧠
requires:
env:
- MATON_API_KEY
---
# MailerLite
Access the MailerLite API with managed OAuth authentication. Manage subscribers, groups, campaigns, automations, forms, fields, segments, and webhooks.
Quick Start
# List subscribers
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/mailerlite/api/subscribers?limit=10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFBase URL
https://gateway.maton.ai/mailerlite/{native-api-path}Replace `{native-api-path}` with the actual MailerLite API endpoint path. The gateway proxies requests to `connect.mailerlite.com` and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY**Environment Variable:** Set your API key as `MATON_API_KEY`:
export MATON_API_KEY="YOUR_API_KEY"Getting Your API Key
1. Sign in or create an account at [maton.ai](https://maton.ai)
2. Go to [maton.ai/settings](https://maton.ai/settings)
3. Copy your API key
Connection Management
Manage your MailerLite OAuth connections at `https://ctrl.maton.ai`.
List Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=mailerlite&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFCreate Connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'mailerlite'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFGet Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF**Response:**
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "mailerlite",
"metadata": {}
}
}Open the returned `url` in a browser to complete OAuth authorization.
Delete Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFSpecifying Connection
If you have multiple MailerLite connections, specify which one to use with the `Maton-Connection` header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/mailerlite/api/subscribers')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFIf omitted, the gateway uses the default (oldest) active connection.
API Reference
Subscriber Operations
#### List Subscribers
GET /mailerlite/api/subscribersQuery parameters:
#### Get Subscriber
GET /mailerlite/api/subscribers/{subscriber_id_or_email}#### Create/Upsert Subscriber
POST /mailerlite/api/subscribers
Content-Type: application/json
{
"email": "subscriber@example.com",
"fields": {
"name": "John Doe",
"company": "Acme Inc"
},
"groups": ["12345678901234567"],
"status": "active"
}Returns 201 for new subscribers, 200 for updates.
#### Update Subscriber
PUT /mailerlite/api/subscribers/{subscriber_id}
Content-Type: application/json
{
"fields": {
"name": "Jane Doe"
},
"status": "active"
}#### Delete Subscriber
DELETE /mailerlite/api/subscribers/{subscriber_id}#### Get Subscriber Activity
GET /mailerlite/api/subscribers/{subscriber_id}/activity-logQuery parameters:
#### Forget Subscriber (GDPR)
POST /mailerlite/api/subscribers/{subscriber_id}/forgetGroup Operations
#### List Groups
GET /mailerlite/api/groupsQuery parameters:
#### Create Group
POST /mailerlite/api/groups
Content-Type: application/json
{
"name": "Newsletter Subscribers"
}#### Update Group
PUT /mailerlite/api/groups/{group_id}
Content-Type: application/json
{
"name": "Updated Group Name"
}#### Delete Group
DELETE /mailerlite/api/groups/{group_id}#### Get Group Subscribers
GET /mailerlite/api/groups/{group_id}/subscribersQuery parameters:
#### Assign Subscriber to Group
POST /mailerlite/api/subscribers/{subscriber_id}/groups/{group_id}#### Remove Subscriber from Group
DELETE /mailerlite/api/subscribers/{subscriber_id}/groups/{group_id}Campaign Operations
#### List Campaigns
GET /mailerlite/api/campaignsQuery parameters:
#### Get Campaign
GET /mailerlite/api/campaigns/{campaign_id}#### Create Campaign
POST /mailerlite/api/campaigns
Content-Type: application/json
{
"name": "My Newsletter",
"type": "regular",
"emails": [
{
"subject": "Weekly Update",
"from_name": "Newsletter",
"from": "newsletter@example.com"
}
],
"groups": ["12345678901234567"]
}#### Update Campaign
PUT /mailerlite/api/campaigns/{campaign_id}
Content-Type: application/json
{
"name": "Updated Campaign Name",
"emails": [
{
"subject": "New Subject Line",
"from_name": "Newsletter",
"from": "newsletter@example.com"
}
]
}Note: Only draft campaigns can be updated.
#### Schedule Campaign
POST /mailerlite/api/campaigns/{campaign_id}/schedule
Content-Type: application/json
{
"delivery": "instant"
}For scheduled delivery:
{
"delivery": "scheduled",
"schedule": {
"date": "2026-03-15",
"hours": "10",
"minutes": "30"
}
}#### Cancel Campaign
POST /mailerlite/api/campaigns/{campaign_id}/cancelReverts a ready campaign to draft status.
#### Delete Campaign
DELETE /mailerlite/api/campaigns/{campaign_id}#### Get Campaign Subscriber Activity
GET /mailerlite/api/campaigns/{campaign_id}/reports/subscriber-activityQuery parameters:
Automation Operations
#### List Automations
GET /mailerlite/api/automationsQuery parameters:
#### Get Automation
GET /mailerlite/api/automations/{automation_id}#### Create Automation
POST /mailerlite/api/automations
Content-Type: application/json
{
"name": "Welcome Series"
}Creates a draft automation.
#### Get Automation Activity
GET /mailerlite/api/automations/{automation_id}/activityQuery parameters:
#### Delete Automation
DELETE /mailerlite/api/automations/{automation_id}Field Operations
#### List Fields
GET /mailerlite/api/fieldsQuery parameters:
#### Create Field
POST /mailerlite/api/fields
Content-Type: application/json
{
"name": "Company",
"type": "text"
}#### Update Field
PUT /mailerlite/api/fields/{field_id}
Content-Type: application/json
{
"name": "Organization"
}#### Delete Field
DELETE /mailerlite/api/fields/{field_id}Segment Operations
#### List Segments
GET /mailerlite/api/segmentsQuery parameters:
#### Get Segment Subscribers
GET /mailerlite/api/segments/{segment_id}/subscribersQuery parameters:
#### Update Segment
PUT /mailerlite/api/segments/{segment_id}
Content-Type: application/json
{
"name": "High Engagement Subscribers"
}#### Delete Segment
DELETE /mailerlite/api/segments/{segment_id}Form Operations
#### List Forms
GET /mailerlite/api/forms/{type}Path parameters:
Query parameters:
#### Get Form
GET /mailerlite/api/forms/{form_id}#### Update Form
PUT /mailerlite/api/forms/{form_id}
Content-Type: application/json
{
"name": "Newsletter Signup"
}#### Delete Form
DELETE /mailerlite/api/forms/{form_id}#### Get Form Subscribers
GET /mailerlite/api/forms/{form_id}/subscribersQuery parameters:
Webhook Operations
#### List Webhooks
GET /mailerlite/api/webhooks#### Get Webhook
GET /mailerlite/api/webhooks/{webhook_id}#### Create Webhook
POST /mailerlite/api/webhooks
Content-Type: application/json
{
"name": "Subscriber Updates",
"events": ["subscriber.created", "subscriber.updated"],
"url": "https://example.com/webhook"
}#### Update Webhook
PUT /mailerlite/api/webhooks/{webhook_id}
Content-Type: application/json
{
"name": "Updated Webhook",
"enabled": true
}#### Delete Webhook
DELETE /mailerlite/api/webhooks/{webhook_id}Pagination
MailerLite uses cursor-based pagination for most endpoints and page-based pagination for some.
Cursor-based Pagination
GET /mailerlite/api/subscribers?limit=25&cursor=eyJpZCI6MTIzNDU2fQResponse includes pagination links:
{
"data": [...],
"links": {
"first": "https://connect.mailerlite.com/api/subscribers?cursor=...",
"last": null,
"prev": null,
"next": "https://connect.mailerlite.com/api/subscribers?cursor=eyJpZCI6MTIzNDU2fQ"
},
"meta": {
"path": "https://connect.mailerlite.com/api/subscribers",
"per_page": 25,
"next_cursor": "eyJpZCI6MTIzNDU2fQ",
"prev_cursor": null
}
}Page-based Pagination
GET /mailerlite/api/groups?limit=25&page=2Response includes page metadata:
{
"data": [...],
"meta": {
"current_page": 2,
"from": 26,
"last_page": 4,
"per_page": 25,
"to": 50,
"total": 100
}
}Code Examples
JavaScript
const response = await fetch(
'https://gateway.maton.ai/mailerlite/api/subscribers?limit=10',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();Python
import os
import requests
response = requests.get(
'https://gateway.maton.ai/mailerlite/api/subscribers',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
params={'limit': 10}
)
data = response.json()Create Subscriber Example
import os
import requests
response = requests.post(
'https://gateway.maton.ai/mailerlite/api/subscribers',
headers={
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
'Content-Type': 'application/json'
},
json={
'email': 'newuser@example.com',
'fields': {'name': 'John Doe'},
'status': 'active'
}
)
data = response.json()Notes
Error Handling
| Status | Meaning |
|--------|---------|
| 400 | Missing MailerLite connection |
| 401 | Invalid or missing Maton API key |
| 403 | Forbidden - insufficient permissions |
| 404 | Resource not found |
| 422 | Validation error |
| 429 | Rate limited (120 req/min) |
| 4xx/5xx | Passthrough error from MailerLite API |
Troubleshooting: API Key Issues
1. Check that the `MATON_API_KEY` environment variable is set:
echo $MATON_API_KEY2. Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOFTroubleshooting: Invalid App Name
1. Ensure your URL path starts with `mailerlite`. For example:
Resources
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...