MailerLite API

Welcome! You'll find comprehensive guides and documentation to help you start working with MailerLite API as quickly as possible, as well as support if you get stuck.

Let's jump right in!

Get Started    Discussions


Webhooks provide an ability to subscribe the real-time notifications about various events occurred in MailerLite. For example, when a new subscriber is added to your account, HTTP POST callback is sent to your provided URL with a payload containing the new subscriber. It allows you to get the most recent updates without polling API constantly.


Currently, you can create subscriptions only using our RESTful API for webhooks. It is documented here.


Our responses contain fat payloads including the information about the event related object so there is no need to make additional API request.

  "events": [
        "account_id": 334443,
        "data": {
          "subscriber": {
            "clicked": 0,
            "date_created": "2017-05-23 14:50:03",
            "date_subscribe": null,
            "date_unsubscribe": null,
            "date_updated": null,
            "email": "",
            "fields": [
            "id": 2300951083,
            "name": "Guy",
            "opened": 0,
            "sent": 0,
            "type": "active"
        "timestamp": 1495551003,
        "type": "subscriber.create",
        "webhook_id": 2

Available events



Fired when a new subscriber is added to an account.


Fired when any of subscriber's custom fields are updated.


Fired when a subscriber becomes unsubscribed.


Fired when a subscriber is added to a group.


Fired when a subscriber is removed from a group.

Batching events

We are sending events in batches every minute. For example, if there are a few events fired and they belong to the same webhook, we group all of them and send a single HTTP request instead of many requests to the same URL.


Webhook requests include X-MailerLite-Signature header, its value is base64 encoded HMAC (sha256) which is generated from payload JSON using your account's API key as a secret key. You can check its validity in order to be guaranteed that a request is sent from our side.

An example of a working function which produces a signature in PHP:


function generateSignature($jsonPayload, $apiKey) {
  return base64_encode(
    hash_hmac('sha256', $jsonPayload, $apiKey, true)


If there is any other response than 2xx from your webhook's endpoint, we attempt to retry our callbacks for a while. However, your webhook is set to inactive after 3 days of responding with an error.

Unsubscribing webhooks

You can stop subscribing events for a particular webhook manually deleting it using API or just giving a response with a status code 410.

Useful tools

Requestbin is a useful tool for testing webhooks quickly and see how it is working without any coding on your side to see what's being sent.

Updated 10 months ago


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.