MailerLite Bridge
Drop-in replacement for the MailerSend transactional API (MailerLite's sending platform) — keep Bearer auth and your existing request structure, swap in your wemail API key.
The MailerLite bridge speaks the MailerSend API — MailerLite's transactional email platform. Point your base URL to https://api.wemail.io/bridge/mailerlite, swap your MailerSend token (mlsn.…) for a wemail API key in the same Authorization: Bearer header, and keep the same request bodies and response shapes.
Authentication
Exactly like MailerSend, the bridge authenticates with Authorization: Bearer <token>. Use your wemail API key (afn_live_… or afn_test_…) where your MailerSend token used to be. Test-environment keys route through the sandbox: messages are accepted, simulated, and never delivered.
Authorization: Bearer afn_live_YOUR_WEMAIL_KEYSupported Endpoints
POST /bridge/mailerlite/v1/email
Send an email — mirrors MailerSend's Send an email endpoint.
GET /bridge/mailerlite/v1/activity/:domainId
List activity/events for a domain — mirrors MailerSend's Activity endpoint. Accepts the domain id or the domain name.
GET /bridge/mailerlite/v1/suppressions
List suppressions — hard bounces, spam complaints, and unsubscribes.
Field-Level Compatibility
POST /v1/email — Request Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
from | object | Required | { email, name? } — must use a domain verified in your wemail workspace. |
to | array | Required | Recipient list [{ email, name? }]. |
cc / bcc | array | Optional | Carbon-copy recipients, same shape as to. |
subject | string | Optional | Required unless template_id is provided. |
html / text | string | Optional | Body parts. At least one of html, text, template_id is required. |
template_id | string | Optional | A wemail template id (tpl_…). MailerSend template ids are not resolvable — recreate the template in wemail (MailerSend's API does not export template content). |
variables / personalization | array | Optional | Substitution data, applied like MailerSend's substitutions. |
tags | array | Optional | Tags, echoed on events and webhooks. |
send_at | string | Optional | Scheduled delivery time. |
settings | object | Optional | { track_clicks?, track_opens? } — mapped to wemail tracking. |
Response
A successful send returns 202 with { "message": "Queued for delivery.", "x_message_id": "msg_…" } and the X-Message-Id response header, matching MailerSend's convention. Validation failures return 422 with { message }.
GET /v1/activity/:domainId
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | Page size, default 25, max 100. |
page | integer | Optional | 1-based page number. |
event | string | Optional | Filter by MailerSend event name: queued, sent, delivered, soft_bounced, hard_bounced, opened, clicked, spam_complaint, unsubscribed. |
date_from / date_to | string | Optional | Date range filters. |
Returns { data: [{ id, type, created_at, email: { id, from, subject, recipient: { email }, tags, message_id }, morph: { ip, user_agent, url } }], links: { first, last, prev, next } }.
GET /v1/suppressions
Returns { data: [{ id, type, email, reason, created_at }] } where type is hard_bounces, spam_complaints, or unsubscribes. Filter with ?type=, paginate with limit/page.
Webhooks
When the MailerLite bridge is active, webhook deliveries are formatted exactly like MailerSend webhooks: a single object { type: "activity.…", created_at, data: { id, message_id, email_id, type, subject, email, tags } } with MailerSend activity names (activity.sent, activity.delivered, activity.hard_bounced, activity.soft_bounced, activity.opened, activity.clicked, activity.unsubscribed, activity.spam_complaint). Payloads carry MailerSend's Signature header — a hex HMAC-SHA256 of the raw body with your endpoint's signing secret.
Known Deviations from MailerSend API
| Parameter | Type | Required | Description |
|---|---|---|---|
template_id | behavior | Optional | MailerSend template ids are not resolvable and template content cannot be exported from MailerSend — recreate templates in wemail and use their tpl_… ids. |
attachments | unsupported | Optional | Not yet supported through the bridge; use the native wemail /v3/send for attachments. |
bulk-email | unsupported | Optional | MailerSend's /v1/bulk-email endpoint is not supported — send one request per message. |
precedence:bulk / list-unsubscribe headers | behavior | Optional | wemail applies its own List-Unsubscribe handling. |
Code examples
curl -X POST https://api.wemail.io/bridge/mailerlite/v1/email \
-H "Authorization: Bearer afn_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": { "email": "sender@yourdomain.com", "name": "Your App" },
"to": [{ "email": "user@example.com" }],
"subject": "Hello from the MailerLite bridge",
"html": "<p>It works — zero code changes.</p>"
}'// MailerSend SDK — point the client at the wemail bridge
const { MailerSend, EmailParams, Sender, Recipient } = require('mailersend');
const mailerSend = new MailerSend({
apiKey: 'afn_live_YOUR_KEY',
baseUrl: 'https://api.wemail.io/bridge/mailerlite/v1',
});
const params = new EmailParams()
.setFrom(new Sender('sender@yourdomain.com', 'Your App'))
.setTo([new Recipient('user@example.com')])
.setSubject('Hello from the MailerLite bridge')
.setHtml('<p>It works — zero code changes.</p>');
await mailerSend.email.send(params);import requests
resp = requests.post(
"https://api.wemail.io/bridge/mailerlite/v1/email",
headers={"Authorization": "Bearer afn_live_YOUR_KEY"},
json={
"from": {"email": "sender@yourdomain.com", "name": "Your App"},
"to": [{"email": "user@example.com"}],
"subject": "Hello from the MailerLite bridge",
"html": "<p>It works — zero code changes.</p>",
},
)
print(resp.status_code, resp.json()) # 202 {'message': 'Queued for delivery.', ...}