This is API V1, which is still supported, but not maintained. We recommend you check out our API V2 version here: developers.mailerlite.com
Email marketing software, services, newsletters

API Documentation

Campaigns

Get all campaigns from your account

GET https://api.mailerlite.com/api/v1/campaigns/

Returns all campaigns you have in your account. Also basic summary for each campaign including the ID

Parameters

Required Parameter Description
Yes apiKey
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$campaigns = $ML_Campaigns->getAll( );

Response example

{
    "Results": [
        {
            "id": "3096"
            "name": "My first campaign",
            "started": "2012-11-12 09:25:01",
            "updated": "2012-11-12 09:25:05",
            "total": "123",
            "opens": "285",
            "uniqueOpens": "82",
            "clicks": "41",
            "unsubscribes": "3",
            "bounces": "7",
            "junk": "1"
        },
        {
            "id": "4589"
            "name": "My second campaign",
            "started": "2013-02-03 15:40:01",
            "updated": "2013-02-03 15:43:11",
            "total": "182",
            "opens": "365",
            "uniqueOpens": "114",
            "clicks": "23",
            "unsubscribes": "2",
            "bounces": "6",
            "junk": "1"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "2"
}

Campaign details

GET https://api.mailerlite.com/api/v1/campaigns/{id}/

Retrieve stats about sent campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$campaign = $ML_Campaigns->setId( CAMPAIGN_ID )->get( );

Response example

{
    "id": "3096"
    "name": "My first campaign",
    "started": "2012-11-12 09:25:01",
    "updated": "2012-11-12 09:25:05",
    "total": "123",
    "opens": "285",
    "uniqueOpens": "82",
    "clicks": "41",
    "unsubscribes": "3",
    "bounces": "7",
    "junk": "1"
}

Campaign recipients

GET https://api.mailerlite.com/api/v1/campaigns/{id}/recipients/

Retrieves a paged result representing all the subscribers that a given campaign was sent to.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getRecipients( );

Response example

{
    "Results": [
        {
            "email": "first@example.com"
        },
        {
            "email": "second@example.com"
        },
        {
            "email": "onemore@example.com"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign opens

GET https://api.mailerlite.com/api/v1/campaigns/{id}/opens/
GET https://api.mailerlite.com/api/v1/campaigns/{id}/opens[{.json|.xml}]/

Retrieves a paged result representing all the subscribers that opened a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getOpens( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:25"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28"
        },
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:33"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign clicks

GET https://api.mailerlite.com/api/v1/campaigns/{id}/clicks/

Retrieves a paged result representing all the subscribers that clicked on a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getClicks( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:41:25",
            "link": "http://www.example.com"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:42:22",
            "link": "http://example.com/offers"
        },
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:43:52",
            "link": "Link to web-based version of this email from plain version"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign unsubscribes

GET https://api.mailerlite.com/api/v1/campaigns/{id}/unsubscribes/

Retrieves a paged result representing all the subscribers that unsubscribed from a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getUnsubscribes( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:25"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28"
        },
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:33"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign bounces

GET https://api.mailerlite.com/api/v1/campaigns/{id}/bounces/

Retrieves a paged result representing all the subscribers who bounced for a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getBounces( );

Response example

{
    "Results": [
        {
            "email": "first@example5.co",
            "date": "2013-02-03 15:40:25",
            "reason": "Unable to route"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28",
            "reason": "Mailbox is full"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "2"
}

Campaign spam complaints

GET https://api.mailerlite.com/api/v1/campaigns/{id}/junk/

Retrieves a paged result representing all the subscribers who bounced for a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

$ML_Campaigns = new MailerLite\Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getJunk( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:25"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "2"
}