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.

bashAuthentication header
Authorization: Bearer afn_live_YOUR_WEMAIL_KEY

Supported 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

Send request fields
ParameterTypeRequiredDescription
fromobjectRequired{ email, name? } — must use a domain verified in your wemail workspace.
toarrayRequiredRecipient list [{ email, name? }].
cc / bccarrayOptionalCarbon-copy recipients, same shape as to.
subjectstringOptionalRequired unless template_id is provided.
html / textstringOptionalBody parts. At least one of html, text, template_id is required.
template_idstringOptionalA wemail template id (tpl_…). MailerSend template ids are not resolvable — recreate the template in wemail (MailerSend's API does not export template content).
variables / personalizationarrayOptionalSubstitution data, applied like MailerSend's substitutions.
tagsarrayOptionalTags, echoed on events and webhooks.
send_atstringOptionalScheduled delivery time.
settingsobjectOptional{ 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

Query parameters
ParameterTypeRequiredDescription
limitintegerOptionalPage size, default 25, max 100.
pageintegerOptional1-based page number.
eventstringOptionalFilter by MailerSend event name: queued, sent, delivered, soft_bounced, hard_bounced, opened, clicked, spam_complaint, unsubscribed.
date_from / date_tostringOptionalDate 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

Deviations
ParameterTypeRequiredDescription
template_idbehaviorOptionalMailerSend template ids are not resolvable and template content cannot be exported from MailerSend — recreate templates in wemail and use their tpl_… ids.
attachmentsunsupportedOptionalNot yet supported through the bridge; use the native wemail /v3/send for attachments.
bulk-emailunsupportedOptionalMailerSend's /v1/bulk-email endpoint is not supported — send one request per message.
precedence:bulk / list-unsubscribe headersbehaviorOptionalwemail applies its own List-Unsubscribe handling.

Code examples

cURL
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>"
  }'
Node.js
// 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);
Python
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.', ...}