Skip to Content
MailerLite
MailerLite API

Automation emails

Read and set the content of an automation email, and read its stats.

Every email step in an automation owns an email. These endpoints set that email's content and report on how it performed.

Setting the HTML is the last thing an automation needs before it can be enabled: a step whose email has no content keeps the automation inactive. The email must belong to the automation you are addressing and to one of its steps, and the automation must be inactive while you change content.

Personalisation variables such as {$name} are kept in the HTML you send and resolved for each subscriber at send time.

If the automation was deleted, these endpoints return 410 Gone.

Reporting periods

The stats endpoints cover the automation's whole history by default. Send start_date and end_date together, as YYYY-MM-DD, to limit them to a period; both days are included. Send shop_id on the e-commerce endpoint to report on a single connected shop instead of all of them.

Get automation email content

If you want to get the HTML body of an automation email use this GET request

GET https://connect.mailerlite.com/api/automations/{automation_id}/emails/{email_id}/content

The HTML comes back as it is stored and sent. Merge tags such as {$name} and {$unsubscribe} and conditional content blocks are returned as written, so you can edit the HTML and send it back with Set automation email content. For an email built in the Custom HTML editor, this is the HTML as written, without the preheader and footer the editor adds to it.

The email must belong to the automation, otherwise the request returns 404. An email that has not been designed yet returns 422. A 503 means the email could not be rendered. Try again.

Response

Response code: 200 OK
{
  "data": {
    "html": "<!DOCTYPE html><html><body><h1>Hi {$name}</h1><p>Thanks for joining.</p><p><a href=\"https://example.com/start\">Get started</a></p><p><a href=\"{$unsubscribe}\">Unsubscribe</a></p></body></html>"
  }
}

Set automation email content

If you want to set the HTML body of an automation email use this PUT request

PUT https://connect.mailerlite.com/api/automations/{automation_id}/emails/{email_id}/content

This replaces the email's HTML body. It is how you give an email step its content, which an automation needs before it can be enabled.

The email must belong to the automation and to one of its email steps, otherwise the request returns 404. The automation must be inactive. A 503 means the email could not be rendered. Try again.

Request body

{
  "html": "<!DOCTYPE html><html><body><h1>Hi {$name}</h1><p>Thanks for joining.</p><p><a href=\"https://example.com/start\">Get started</a></p><p><a href=\"{$unsubscribe}\">Unsubscribe</a></p></body></html>"
}
ParameterTypeRequiredLimitations
htmlstringyesThe email's full HTML body. Personalisation variables such as {$name} are kept and resolved at send time

Response

Response code: 200 OK
{
  "data": {
    "id": "203114224708224206",
    "account_id": "1",
    "emailable_id": "203114220633457868",
    "emailable_type": "automations",
    "type": "builder_html",
    "from": "dummy@example.com",
    "from_name": "Dummy Testerson",
    "reply_to": "dummy@example.com",
    "name": "Welcome email",
    "subject": "Welcome to the newsletter, {$name}",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <!--{$head_top}--><!--{$head_bottom}-->\n    <title>Welcome to the newsletter, {$name}</title>\n  </head>\n  <body class=\"\" style=\"\">\n    <!--{$body_top}-->\n    <h1>\n      Hi {$name}\n    </h1>\n ...",
    "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\n...",
    "screenshot_url": null,
    "uses_new_builder": false,
    "uses_landscape_screenshot": true,
    "generate_screenshot_timestamp": "2026-11-03 11:20:56",
    "is_building_content": false,
    "preview_url": "https://preview.mailerlite.io/emails/1234567890/preview",
    "report_preview_url": "https://preview.mailerlite.io/emails/1234567890/preview",
    "created_at": "2026-11-03 11:20:19",
    "updated_at": "2026-11-03 11:20:56",
    "is_designed": true,
    "language_id": null,
    "language": {
      "id": "4",
      "shortcode": "en",
      "iso639": "en-US",
      "name": "English",
      "direction": "ltr"
    },
    "is_winner": false,
    "stats": {
      "sent": 0,
      "opens_count": 0,
      "open_rate": {
        "float": 0,
        "string": "0%"
      },
      "clicks_count": 0,
      "click_rate": {
        "float": 0,
        "string": "0%"
      },
      "unsubscribes_count": 0,
      "unsubscribe_rate": {
        "float": 0,
        "string": "0%"
      },
      "spam_count": 0,
      "spam_rate": {
        "float": 0,
        "string": "0%"
      },
      "hard_bounces_count": 0,
      "hard_bounce_rate": {
        "float": 0,
        "string": "0%"
      },
      "soft_bounces_count": 0,
      "soft_bounce_rate": {
        "float": 0,
        "string": "0%"
      },
      "deliveries_count": 0,
      "delivery_rate": {
        "float": 0,
        "string": "0%"
      },
      "forwards_count": 0,
      "forward_rate": {
        "float": 0,
        "string": "0%"
      },
      "social_interactions_count": 0,
      "social_interaction_rate": {
        "float": 0,
        "string": "0%"
      },
      "click_to_open_rate": {
        "float": 0,
        "string": "0%"
      }
    },
    "send_after": null,
    "track_opens": true,
    "uses_survey": false,
    "uses_quiz": false,
    "preheader": null
  }
}

Get automation email stats

If you want to get the engagement and deliverability stats of an automation email use this GET request

GET https://connect.mailerlite.com/api/automations/{automation_id}/emails/{email_id}/report-stats

Returns sends, opens, clicks, unsubscribes, spam complaints, bounces and the rates derived from them. Covers the automation's whole history by default.

Request parameters

ParameterTypeRequiredLimitations
start_datestringnoFirst day to report on, as YYYY-MM-DD. Required together with end_date. Omit both to report on the automation's whole history
end_datestringnoLast day to report on, as YYYY-MM-DD. Included in the period. Required together with start_date
shop_idstringnoReport only on orders from this connected shop, by e-commerce shop ID. Applies to e-commerce figures only

Response

Response code: 200 OK
{
  "data": {
    "engagement": {
      "sent": 0,
      "opens_count": 0,
      "clicks_count": 0,
      "total_opens_count": 0,
      "total_clicks_count": 0,
      "open_rate": {
        "string": "0%"
      },
      "click_rate": {
        "string": "0%"
      },
      "click_to_open_rate": {
        "string": "0%"
      },
      "forwards_count": 0,
      "forward_rate": {
        "string": "0%"
      },
      "social_interactions_count": 0,
      "social_interaction_rate": {
        "string": "0%"
      }
    },
    "deliverability": {
      "sent": 0,
      "delivered_count": 0,
      "delivered_rate": {
        "string": "0%"
      },
      "hard_bounce_rate": {
        "string": "0%"
      },
      "hard_bounces_count": 0,
      "soft_bounces_count": 0,
      "soft_bounce_rate": {
        "string": "0%"
      },
      "spam_count": 0,
      "spam_rate": {
        "string": "0%"
      },
      "unsubscribes_count": 0,
      "unsubscribe_rate": {
        "string": "0%"
      }
    }
  }
}

Get automation email e-commerce stats

If you want to get the orders attributed to an automation email use this GET request

GET https://connect.mailerlite.com/api/automations/{automation_id}/emails/{email_id}/ecommerce-overview-stats

Returns the order count, revenue, average order value and conversion rate. Covers the automation's whole history by default.

Request parameters

ParameterTypeRequiredLimitations
start_datestringnoFirst day to report on, as YYYY-MM-DD. Required together with end_date. Omit both to report on the automation's whole history
end_datestringnoLast day to report on, as YYYY-MM-DD. Included in the period. Required together with start_date
shop_idstringnoReport only on orders from this connected shop, by e-commerce shop ID

Response

Response code: 200 OK
{
  "data": {
    "ecommerce": {
      "orders_count": 0,
      "revenue": 0,
      "average_order_value": 0,
      "conversion_rate": "0%"
    }
  }
}

List automation email unsubscribe reasons

If you want to see why subscribers unsubscribed from an automation email use this GET request

GET https://connect.mailerlite.com/api/automations/{automation_id}/emails/{email_id}/unsubscribe-reasons

Returns each reason subscribers gave, with a count and a share of the total. Reasons nobody picked are left out.

Response

Response code: 200 OK
{
  "data": [
    {
      "label": "The emails are too frequent",
      "count": 3,
      "percentage": 60
    },
    {
      "label": "I no longer want to receive these emails",
      "count": 2,
      "percentage": 40
    }
  ]
}

On this page