NAV Navigation
JavaScript PHP Python

API guide

Hello, developers! This is the official documentation for the API of Mailmojo.no, the leading Norwegian email marketing service. Here you’ll find most everything you need to start building your custom integration with our service. But before you start, you’ll want to contact us to get an API client. We currently don’t have online signups for that yet.

Getting Started

Let’s get you up and running with the Mailmojo API!

Using our API you’ll be able to implement integrations with Mailmojo and perform things like synchronize email lists, subscribe/unsubscribe contacts or even completely embed our newsletter creation process in your application.

Our API is under active development and new features will be added. Please come back later to see what’s new and what other magical things you can do with it to enrich your own applications.

First of all you’ll need to know how to use OAuth 2 for authentication. Most languages have robust libraries to handle the nitty gritty for you. Review our Authentication for more details about it.

Once you got authentication in place you can start browsing our API endpoints and play with them in our reference documentation and API Explorer.

For our full blown embedded solution where you can get Mailmojo running inside your own application, see our Embed guide.

Authentication flow

The Mailmojo API uses OAuth 2.0 for authenticating requests. For a deeper understanding of OAuth 2.0 you can check out RFC 6749, but we’ll give an introduction here.

Your client credentials and access tokens

Your application will need to have a client ID and a client secret which is used for the basic authentication requests. With these you’ll be able to get an access token as well as a refresh token. The access token is what you’ll provide in any other API requests to authorize the request.

The client ID and client secret can be accessed from within Mailmojo under “Min konto” and “API-tilgang” if you have a client set up for you. It’s important to note that the client secret should be protected like a password and never be leaked to any other user agent or client.

Getting an access token for a user account

Once you have your client ID and secret you can ask for an access token for a Mailmojo account. The usual way you’ll do this is ask a user of your application to authorize your client with access to their Mailmojo account.

This is done by sending the user to the authorize endpoint of our API:

https://api.mailmojo.no/oauth/authorize/

There are some important query parameters you’ll need to provide to this endpoint:

Parameter Description
client_id Your client ID, identifying your application.
response_type What you want in return, should in this case always be code.
redirect_uri The URL in your application where you’ll handle the response.
scope A space-separated list of scopes you want access to. See the Scopes documentation for a list of our supported scopes.
state An unguessable random string. It is used to protect against cross-site request forgery attacks.

Now your user will be guided through a process on our side of logging into their account and granting access to your application. They’ll be informed of everything your asking for access to (the scopes) before doing so.

We will redirect back to the URL provided as redirect_uri, and if you were granted access a temporary code will be provided in a query parameter named code as well as the state you provided in the previous step in a state parameter. If the states don’t match, the request has been created by a third party and the process should be aborted.

Next, you exchange the temporary code for an access token for the user by sending a POST request to the token endpoint of our API:

https://api.mailmojo.no/oauth/token/

For this request there’s some parameters that must be provided as form data in the request body, using the application/x-www-form-urlencoded content type.

Parameter Description
code The code you received.
grant_type This should always be authorization_code.
redirect_uri The same as provided to get the code.
scope The same as provided to get the code.

Example of base 64 encoding authentication header

const pwd = window.btoa('my client id:my client secret');
from base64 import b64encode
pwd = b64encode('my client id:my client secret')
$pwd = base64_encode('my client id:my client secret');

Example response from the OAuth token endpoint

{
    "token_type": "Bearer",
    "access_token": "VmyXcq4828rPLG693LvICvijY2C7cw",
    "scope": "embed",
    "refresh_token": "NJuqNZtWodxkGLGabCbW3SeBnaxS0b",
    "expires_in": 3600
}

This request needs to provide client authentication through HTTP Basic authentication. The password used is a base 64 encoded version of your client ID and secret separated by a colon.

Use this encoded password in a HTTP header in your request like this: Authorization: Basic <password>.

The response provides you with both an access token and a refresh token. The refresh token can be used later to renew the token after the period in expires_in has elapsed.

Getting an access token for your API client

Some API endpoints are not directly related to a specific user account, and requires an access token for your API client. To get such an access token you’ll make a similar request to the API token endpoint as when exchanging a code for a token described in the previous section. This includes the use of your client credentials as HTTP Basic password.

Example response from the OAuth token endpoint for API client token

But for this request the parameters provided as form data are as follows:

{
    "token_type": "Bearer",
    "access_token": "VmyXcq4828rPLG693LvICvijY2C7cw",
    "scope": "account_creation",
    "expires_in": 7776000
}
Parameter Description
grant_type This should always be client_credentials in this case.
scope The scopes you want an access token for.

A successful request will give the same type of response as for a user account access token, except you won’t get a refresh token:

As you see in the example to the right, these tokens have a longer lifetime, currently at 90 days, but after that they expire. When the token is expired you’ll get a 401 Unauthorized response when trying to use the token.

Since you don’t get a refresh token for these access tokens, you’ll need to make a new request to the token endpoint with your client credentials.

Getting an access token for an automatically created user account

For API clients with access to create new accounts we also allow a way to get access tokens for these accounts without having the user grant explicit access. These accounts are viewed as managed by the API clients, and the user generally do not have login credentials for it. A user specific access token is necessary to perform any API requests on behalf of the user, e.g. getting email lists or creating embed sessions.

To get such an access token you’ll also make a single request to the API token endpoint, but using an access token for your API client as the password. Use the method described in the previous section to get this access token, then send a POST request to the API token endpoint with the following request parameters as form data:

Parameter Description
grant_type This should always be password in this case.
username The username of the account your want an access token for.
password Your API client access token.
scope The scopes you want an access token for.

As usual, your client credentials should be supplied in HTTP Basic authentication for the request as well. A successful request will give the same type of response as shown in the two previous sections.

Authorizing API requests

Once you have received an access token through the steps described above, you can make API requests on behalf of the account the access token was granted for.

To authorize API requests you simply provide the access token in an HTTP header like this: Authorization: Bearer <token>. If you receive a 403 Forbidden response from the API it means the token is invalid, probably because it has expired.

Refreshing an access token

In the response from our token endpoint as shown above you will get a refresh token together with the access token itself. Storing this for later is highly useful and recommended, as you can get a new access token by one simple request once the original expires.

This is done by sending a POST request to the token endpoint again with the same client authentication as described before, but this time providing the following parameters in the request body instead:

Parameter Description
grant_type This should be refresh_token.
refresh_token The refresh token itself.

On success you’ll get the same type of response as shown above when initially getting an access token, including a new access token as well as a new refresh token that should again be stored for future use.

Scopes

When authenticating as described in the Authentication documentation you’ll need to specify which scopes you are asking for access to. It is good practice to never ask for more scopes than you actually need, because the user will be asked to explicitly grant you access to all scopes you ask for.

See the Mailmojo API reference below for a complete list of supported scopes.

Accounts

Basic account information can be updated through the API, limited to the account name and contact information. Username and account plan with related details can not be updated.

For partner integrations we also allow account creation. This however requires special approval from us to make use of.

Requirements

You’ll need an API client with access to the API scope account to update account information, and account_creation or account_creation.trial_30 to create accounts.

To update account information you’ll need an access token for the Mailmojo account of the user. To create an account you’ll need an access token for your own partner account. How to obtain these are explained in more detail in our Authentication documentation.

Updating account information

Example account update request body

{
    "name": "Company Name",
    "contact_email": "mail@example.org",
    "contact_name": "John Doe",
    "address": "1234 Street Address",
    "zip_code": "92020",
    "city": "San Diego"
}

Given an access token with the correct scope as mentioned in the requirements, this is a simple PATCH request to the account API endpoint for a specific user:

https://api.mailmojo.no/v1/accounts/{username}/

Replace {username} in the URL with the account username. The actual account information is sent as a JSON object in the request body. Thus make sure you pass the Content-Type header with value application/json.

With a successful request you’ll receive the updated account information in return as a JSON object, including other details about the account like account plan and when it was created.

Creating a new account

As mentioned, this requires special approval to request. If you’ve been in contact with us about this and gotten approval, your API client will also have access to the account_creation scope.

Example account creation request body

{
    "username": "newusername",
    "name": "Company Name",
    "email": "mail@example.org"
}

With an access token for your API client (see our Authentication documentation for how to obtain), creating a new account is a POST request to the account API endpoint:

https://api.mailmojo.no/v1/account/

You’ll have to supply the new account details to the account API endpoint, sent as a JSON object in the request body. Thus make sure you pass the Content-Type header with value application/json.

The username has some strict requirements of which failure to pass these will give you a validation error in response. A username can only contain letters, numbers and the hyphen character. In addition an account with the same username can not exist already. If you receive a validation error specifying invalid username, please ensure you’re not using invalid characters or try to generate a new unique username.

Trial periods

If you’ve also received access to the account_creation.trial_30 scope you can also pass in a property for a 30 day trial period on the new account. Add a trial_days property with the value 30 to the account creation request body.

Embed

To provide a truly seamless experience for your users and increase the value of your own product you can embed Mailmojo!

We currently support embedding the newsletter creation flow. This gives users access to all their newsletters with basic statistics, in addition to being able to create newsletters. All directly from within you application.

Requirements

You’ll need an API client with access to the API scope embed. Additionally you’ll need an access token for the Mailmojo account of the user. How to obtain the latter is explained in more detail in our Authentication documentation.

Creating a new embed session

Each time the user wants to access his newsletters or create a new one you’ll need to create a new embed session on behalf of the user. Given an access token with the correct scope as mentioned in the requirements, this is a simple POST request to the embed API endpoint:

https://api.mailmojo.no/v1/embed/

Example embed creation request body

{
    "session_type": "newsletters",
    "user_ip": "127.0.0.1"
}

You’ll have to supply some parameters to the embed API endpoint, sent as a JSON object in the request body. Thus make sure you pass the Content-Type header with value application/json.

Example embed creation with options request body

{
    "session_type": "newsletters",
    "user_ip": "127.0.0.1",
    "options": {
        "enable_newsletters_index": true,
        "locale": "nb_NO",
        "enable_theme": false
    }
}

Make sure to pass in the correct IP address of the end-user. This is used to validate that only the user initiating the session can access it.

In addition you can provide some further options to customize the embed. A complete example of currently supported options are shown on the right.

You’ll usually want to leave the enable_newsletters_index at its default value. Setting this to false will only allow users to create new newsletters and won’t give them access to drafts or previously sent newsletters.

For locale we currently support the following locales: en_US, nb_NO and sv_SE. Use this to align the user interface language with your own application.

Lastly the enable_theme option will only be useful for clients that have been granted access to theme the user interface. The theme itself will have to be created in conjunction with us and hosted on our servers.

Displaying the embed

The response from a request to the embed endpoint as described above will be HTML with a &lt;script&gt; element. Inject this HTML into your application view where you’d like, and the JavaScript referred to in the &lt;script&gt; element will take care of setting everything up and keeping it in sync with scroll and view size of your application.

API reference

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

v1 of the Mailmojo API

Base URLs:

Email: Mailmojo Web: Mailmojo

Authentication

Scope Scope Description
account Manage your Mailmojo account.
account_creation Create new Mailmojo accounts.
account_creation.trial_30 Create new Mailmojo accounts with a 30 day trial period.
account_settings Manage your Mailmojo account settings.
campaigns Manage your automated campaigns.
campaigns:read Retrieve your automated campaigns.
contacts Manage your contacts across all your email lists.
contacts:read Retrieve your contacts across all your email lists.
embed Give you an embedded Mailmojo application with access to your account.
events Track events on your forms and landing pages.
forms Manage your forms.
forms:read Retrieve your forms.
lists Manage your email lists, excluding subscribers.
lists:read Retrieve your email lists, excluding subscribers.
newsletters Manage your newsletters.
newsletters:read Retrieve your newsletters.
pages Manage your landing pages.
pages:read Retrieve your landing pages.
subscribe Add subscribers to email lists.
templates Manage your templates.
templates:read Retrieve your templates
webhooks Manage your webhooks.

Account

createAccount

Code samples

const inputBody = '{
  "email": "user@example.com",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "trial_days": 0,
  "username": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/accounts/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/accounts/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/accounts/', params={

}, headers = headers)

print r.json()

POST /v1/accounts/

Create an account.

Body parameter

{
  "email": "user@example.com",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "trial_days": 0,
  "username": "string"
}

Parameters

Name In Type Required Description
body body UserCreation true

Example responses

201 Response

{
  "address": "string",
  "city": "string",
  "contact_email": "user@example.com",
  "contact_name": "string",
  "created": "2019-08-24T14:15:22Z",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "trial_expires": "2019-08-24",
  "username": "string",
  "zip_code": "string"
}

Responses

Status Meaning Description Schema
201 Created The user created. User
400 Bad Request An errors object. Inline

Response Schema

getAccountByUsername

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/accounts/{username}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/accounts/{username}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/accounts/{username}/', params={

}, headers = headers)

print r.json()

GET /v1/accounts/{username}/

Retrieve account details.

This endpoint can be used to get details about your own account, or a subuser associated with you as a partner. If the username of your current authenticated user is unknown, you may use the special username ‘me’ to retrieve details about the authenticated user account.

Parameters

Name In Type Required Description
username path string true Username of the account to get details for, or the special username me to get details about your authenticated user.

Example responses

200 Response

{
  "address": "string",
  "city": "string",
  "contact_email": "user@example.com",
  "contact_name": "string",
  "created": "2019-08-24T14:15:22Z",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "trial_expires": "2019-08-24",
  "username": "string",
  "zip_code": "string"
}

Responses

Status Meaning Description Schema
200 OK Details about the account and user. User
400 Bad Request An errors object. Inline
404 Not Found If the username does not exist or you do now have authorization to get details about the given account. None

Response Schema

updateAccount

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/accounts/{username}/',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/accounts/{username}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/accounts/{username}/', params={

}, headers = headers)

print r.json()

POST /v1/accounts/{username}/

Update account details.

Parameters

Name In Type Required Description
username path string true Username of the user to update.

Example responses

200 Response

{
  "address": "string",
  "city": "string",
  "contact_email": "user@example.com",
  "contact_name": "string",
  "created": "2019-08-24T14:15:22Z",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "trial_expires": "2019-08-24",
  "username": "string",
  "zip_code": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated user. User
400 Bad Request An errors object. Inline
404 Not Found If the username does not exist or does not match authenticated user. None

Response Schema

getDomains

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/domains/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/domains/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/domains/', params={

}, headers = headers)

print r.json()

GET /v1/domains/

Retrieve a list of all domains and their status.

Example responses

200 Response

[
  {}
]

Responses

Status Meaning Description Schema
200 OK An array of domains. Inline

Response Schema

getDomain

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/domains/{domain_id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/domains/{domain_id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/domains/{domain_id}/', params={

}, headers = headers)

print r.json()

GET /v1/domains/{domain_id}/

Retrieve domain details and authentication status.

Parameters

Name In Type Required Description
domain_id path int true

Example responses

200 Response

{
  "created_at": "2019-08-24T14:15:22Z",
  "domain": "string",
  "has_authentication": true,
  "id": 0,
  "is_confirmed": true,
  "is_dmarc_passed": true,
  "is_dns_verified": true,
  "is_free_domain": false,
  "is_spf_dkim_passed": true,
  "spf_status": null,
  "type": "string"
}

Responses

Status Meaning Description Schema
200 OK Details about the domain. Domain
404 Not Found If the domain does not exist. None

Automation

getCampaignById

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/campaigns/{campaign_id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/campaigns/{campaign_id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/campaigns/{campaign_id}/', params={

}, headers = headers)

print r.json()

GET /v1/campaigns/{campaign_id}/

Retrieve an automation campaign by id.

Parameters

Name In Type Required Description
campaign_id path integer true ID of the automation campaign to retrieve.

Example responses

200 Response

{
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "name": "string",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_recipients": 0,
    "open_rate": 0.1
  },
  "utm_campaign": "string"
}

Responses

Status Meaning Description Schema
200 OK The automation campaign retrieved. CampaignDetail
404 Not Found If the automation campaign does not exist. None

Contact

getContacts

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/contacts/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/contacts/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/contacts/', params={

}, headers = headers)

print r.json()

GET /v1/contacts/

Retrieve all contacts across every list.

This endpoint currently returns all contacts in your account without any pagination and should be considered EXPERIMENTAL. The response schema will change without any warning in the near future to account for pagination.

Example responses

200 Response

[
  {
    "added": "2019-08-24T14:15:22Z",
    "custom": null,
    "email": "user@example.com",
    "first_name": "string",
    "last_name": "string",
    "list_associations": [
      {
        "added": "2019-08-24T14:15:22Z",
        "email": "string",
        "list_id": 0,
        "status": "a",
        "status_changed": "2019-08-24T14:15:22Z"
      }
    ],
    "name": "string",
    "phone": "string",
    "status": "a",
    "status_changed": "2019-08-24T14:15:22Z",
    "tags": [
      "string"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK An array of contacts. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Contact] false none
» added string(date-time) false none
» custom any false none
» email string(email) true none
» first_name string false none
» last_name string false none
» list_associations [ContactList] false none
»» added string(date-time) false none
»» email string true none
»» list_id integer(int32) true none
»» status string false none
»» status_changed string(date-time) false none
» name string false none Full name of the contact. Will, if present, take precedence over first_name and last_name.
» phone string false none
» status string false none
» status_changed string(date-time) false none
» tags [string] false none
Enumerated Values
Property Value
status a
status u
status b
status d
status a
status u
status b
status d

getHistoricalContactStats

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/contacts/stats/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/contacts/stats/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/contacts/stats/', params={

}, headers = headers)

print r.json()

GET /v1/contacts/stats/

Retrieve historical stats over contacts across every list.

Parameters

Name In Type Required Description
start_date query string(date) false The starting date to include stats from.

Example responses

200 Response

[
  {
    "added": 0,
    "bounced": 0,
    "date": "2019-08-24",
    "deleted": 0,
    "sum": 0,
    "unsubscribed": 0
  }
]

Responses

Status Meaning Description Schema
200 OK An array of stats per day and status. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [HistoricalContactsStats] false none
» added integer(int32) false none
» bounced integer(int32) false none
» date string(date) false none
» deleted integer(int32) false none
» sum integer(int32) false none
» unsubscribed integer(int32) false none

getContactByEmail

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/contacts/{email}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/contacts/{email}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/contacts/{email}/', params={

}, headers = headers)

print r.json()

GET /v1/contacts/{email}/

Retrieve a contact in any list by email.

Parameters

Name In Type Required Description
email path string true

Example responses

200 Response

{
  "added": "2019-08-24T14:15:22Z",
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-08-24T14:15:22Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-08-24T14:15:22Z"
    }
  ],
  "name": "string",
  "phone": "string",
  "status": "a",
  "status_changed": "2019-08-24T14:15:22Z",
  "tags": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK The contact retrieved. Contact
404 Not Found If a contact with the given email does not exist. None

updateContact

Code samples

const inputBody = '{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "tags": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/contacts/{email}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/contacts/{email}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/contacts/{email}/', params={

}, headers = headers)

print r.json()

PATCH /v1/contacts/{email}/

Update details about a contact.

Body parameter

{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "tags": [
    "string"
  ]
}

Parameters

Name In Type Required Description
email path string(email) true Email address of contact to update.
body body BaseContact false

Example responses

200 Response

{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "tags": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK The updated contact. BaseContact
400 Bad Request An errors object. Inline
404 Not Found If the contact does not exist. None

Response Schema

Embed

createEmbedSession

Code samples

const inputBody = '{
  "options": {},
  "session_type": "newsletters",
  "user_ip": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'text/html',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/embed/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'text/html',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/embed/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'text/html',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/embed/', params={

}, headers = headers)

print r.json()

POST /v1/embed/

Create a new embedded application session.

Body parameter

{
  "options": {},
  "session_type": "newsletters",
  "user_ip": "string"
}

Parameters

Name In Type Required Description
body body Embed true

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK A JavaScript <script> snippet to use to initialize the created embed session. string
400 Bad Request An errors object. Inline

Response Schema

Response Headers

Status Header Type Format Description
200 Location string The URL to use to initialize the embed session, if the JavaScript snippet is not to be used (i.e. if opening the embed in a separate window).

Form

getForms

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/forms/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/forms/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/forms/', params={

}, headers = headers)

print r.json()

GET /v1/forms/

Retrieve all forms.

Parameters

Name In Type Required Description
is_published query boolean false List only published forms.

Example responses

200 Response

[
  {
    "config": {},
    "confirmation_html": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "editor_confirmation_html": "string",
    "editor_html": "string",
    "expired_at": "2019-08-24T14:15:22Z",
    "final_confirmation_html": "string",
    "final_html": "string",
    "html": "string",
    "id": 0,
    "lid": 0,
    "name": "string",
    "public_url": "string",
    "published_at": "2019-08-24T14:15:22Z",
    "styles": "string",
    "template_id": 0,
    "trigger": [
      {
        "rules": [
          {
            "trigger_type": "string",
            "value": 0
          }
        ]
      }
    ],
    "type": "embedded",
    "updated_at": "2019-08-24T14:15:22Z"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of forms. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Form] false none
» config object true none
» confirmation_html string true none
» created_at string(date-time) false read-only
» editor_confirmation_html string false read-only
» editor_html string false read-only
» expired_at string(date-time) false read-only
» final_confirmation_html string false read-only
» final_html string false read-only
» html string true none
» id integer(int32) false read-only
» lid integer(int32) true none
» name string true none
» public_url string(url) false read-only
» published_at string(date-time) false read-only
» styles string false read-only
» template_id integer(int32) false none
» trigger [Trigger] false none
»» rules [TriggerRule] false none
»»» trigger_type string true none
»»» value integer(int32) false none
»» type string true none
»» updated_at string(date-time) false read-only
Enumerated Values
Property Value
type embedded
type subscribe
type subscribe_popup
type unsubscribe
type profile
type forward

getFormById

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/forms/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/forms/{id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/forms/{id}/', params={

}, headers = headers)

print r.json()

GET /v1/forms/{id}/

Retrieve a form.

Parameters

Name In Type Required Description
id path integer true ID of the form to retrieve.

Example responses

200 Response

{
  "config": {},
  "confirmation_html": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "final_confirmation_html": "string",
  "final_html": "string",
  "html": "string",
  "id": 0,
  "lid": 0,
  "name": "string",
  "public_url": "string",
  "published_at": "2019-08-24T14:15:22Z",
  "styles": "string",
  "template_id": 0,
  "trigger": [
    {
      "rules": [
        {
          "trigger_type": "string",
          "value": 0
        }
      ]
    }
  ],
  "type": "embedded",
  "updated_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK The form retrieved. Form
404 Not Found If the form does not exist. None

updateForm

Code samples

const inputBody = '{
  "config": {},
  "confirmation_html": "string",
  "html": "string",
  "lid": 0,
  "name": "string",
  "template_id": 0,
  "trigger": [
    {
      "rules": [
        {
          "trigger_type": "string",
          "value": 0
        }
      ]
    }
  ],
  "type": "embedded"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/forms/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/forms/{id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/forms/{id}/', params={

}, headers = headers)

print r.json()

PATCH /v1/forms/{id}/

Update a form partially.

Body parameter

{
  "config": {},
  "confirmation_html": "string",
  "html": "string",
  "lid": 0,
  "name": "string",
  "template_id": 0,
  "trigger": [
    {
      "rules": [
        {
          "trigger_type": "string",
          "value": 0
        }
      ]
    }
  ],
  "type": "embedded"
}

Parameters

Name In Type Required Description
id path integer true ID of the form to update.
body body Form false

Example responses

200 Response

{
  "config": {},
  "confirmation_html": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "final_confirmation_html": "string",
  "final_html": "string",
  "html": "string",
  "id": 0,
  "lid": 0,
  "name": "string",
  "public_url": "string",
  "published_at": "2019-08-24T14:15:22Z",
  "styles": "string",
  "template_id": 0,
  "trigger": [
    {
      "rules": [
        {
          "trigger_type": "string",
          "value": 0
        }
      ]
    }
  ],
  "type": "embedded",
  "updated_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK The updated form. Form
400 Bad Request An errors object. Inline
404 Not Found If the form does not exist. None

Response Schema

formAddSubscriber

Code samples

const inputBody = '{
  "contact": {
    "custom": null,
    "email": "user@example.com",
    "first_name": "string",
    "last_name": "string",
    "name": "string",
    "phone": "string",
    "tags": [
      "string"
    ]
  },
  "page_view_id": null,
  "view_id": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/forms/{id}/subscribers/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/forms/{id}/subscribers/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/forms/{id}/subscribers/', params={

}, headers = headers)

print r.json()

PATCH /v1/forms/{id}/subscribers/

Add a subscriber through a form and track the conversion.

Body parameter

{
  "contact": {
    "custom": null,
    "email": "user@example.com",
    "first_name": "string",
    "last_name": "string",
    "name": "string",
    "phone": "string",
    "tags": [
      "string"
    ]
  },
  "page_view_id": null,
  "view_id": 0
}

Parameters

Name In Type Required Description
id path integer true ID of the form.
body body AddFormSubscriber true

Example responses

201 Response

{
  "converted_at": "2019-08-24T14:15:22Z",
  "id": 0
}

Responses

Status Meaning Description Schema
201 Created The tracked conversion. FormConversion
400 Bad Request An errors object. Inline
404 Not Found If the form does not exist. None

Response Schema

trackFormView

Code samples

const inputBody = '{
  "form_id": 0,
  "trigger": {},
  "user_agent": "string",
  "view_url": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/forms/{id}/track/view/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/forms/{id}/track/view/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/forms/{id}/track/view/', params={

}, headers = headers)

print r.json()

PATCH /v1/forms/{id}/track/view/

Track a view of a form.

Body parameter

{
  "form_id": 0,
  "trigger": {},
  "user_agent": "string",
  "view_url": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}

Parameters

Name In Type Required Description
id path integer true ID of the form to track view of.
body body TrackFormView true

Example responses

201 Response

{
  "form_id": 0,
  "id": 0,
  "trigger": {},
  "user_agent": "string",
  "view_url": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}

Responses

Status Meaning Description Schema
201 Created The tracked view. TrackFormView
400 Bad Request An errors object. Inline
404 Not Found If the form does not exist. None

Response Schema

List

getLists

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/lists/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/lists/', params={

}, headers = headers)

print r.json()

GET /v1/lists/

Retrieve all email lists.

Example responses

200 Response

[
  {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of lists. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [List] false none
» created string(date-time) false read-only
» data_retention any false none If set (to a number of days), automatic cleanup of inactive contacts will be enabled and performed every X days.
» description string false none
» enable_link_proxy boolean false none Beta feature: Whether to block robots from following links in newsletters.
» enable_recaptcha boolean false none Whether to enable reCAPTCHA to block spam subscriptions from the default subscribe form.
» enable_stats_filter boolean false none Beta feature: Whether to block robots that trigger opens and clicks from being tracked in reports.
» facebook string(url)¦null false none
» from_email string(email) true none
» from_name string true none
» id integer(int32) false read-only
» instagram string¦null false none
» is_primary boolean false none Whether this is the primary email list on the account.
» last_cleaned_at string(date-time) false read-only When cleanup of inactive contacts were last performed.
» linkedin string(url)¦null false none
» name string true none
» pinterest string¦null false none
» subscribe_redirect_url string(url)¦null false none
» subscribe_url string false read-only
» twitter string¦null false none
» unsubscribe_cascades boolean false none
» unsubscribe_redirect_url string(url)¦null false none
» unsubscribe_url string false read-only
» website string(url)¦null false none
» youtube string¦null false none

createList

Code samples

const inputBody = '{
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "instagram": "string",
  "is_primary": true,
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "subscribe_redirect_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "website": "string",
  "youtube": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/lists/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/lists/', params={

}, headers = headers)

print r.json()

POST /v1/lists/

Create an email list.

Body parameter

{
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "instagram": "string",
  "is_primary": true,
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "subscribe_redirect_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "website": "string",
  "youtube": "string"
}

Parameters

Name In Type Required Description
body body List true

Example responses

201 Response

{
  "created": "2019-08-24T14:15:22Z",
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "is_primary": true,
  "last_cleaned_at": "2019-08-24T14:15:22Z",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "subscribe_redirect_url": "string",
  "subscribe_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "unsubscribe_url": "string",
  "website": "string",
  "youtube": "string"
}

Responses

Status Meaning Description Schema
201 Created All details of the list that was created by the call. List
400 Bad Request An errors object. Inline

Response Schema

getListById

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/lists/{list_id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/lists/{list_id}/', params={

}, headers = headers)

print r.json()

GET /v1/lists/{list_id}/

Retrieve an email list.

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to retrieve.

Example responses

200 Response

{
  "created": "2019-08-24T14:15:22Z",
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "is_primary": true,
  "last_cleaned_at": "2019-08-24T14:15:22Z",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "created": "2019-08-24T14:15:22Z",
      "id": 0,
      "name": "string",
      "num_contacts": 0,
      "type": null
    }
  ],
  "subscribe_redirect_url": "string",
  "subscribe_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "unsubscribe_url": "string",
  "website": "string",
  "youtube": "string"
}

Responses

Status Meaning Description Schema
200 OK The list retrieved. ListDetail
404 Not Found If the email list does not exist. None

updateList

Code samples

const inputBody = '{
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "instagram": "string",
  "is_primary": true,
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "name": "string"
    }
  ],
  "subscribe_redirect_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "website": "string",
  "youtube": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/lists/{list_id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/lists/{list_id}/', params={

}, headers = headers)

print r.json()

PATCH /v1/lists/{list_id}/

Update an email list partially.

Body parameter

{
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "instagram": "string",
  "is_primary": true,
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "name": "string"
    }
  ],
  "subscribe_redirect_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "website": "string",
  "youtube": "string"
}

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to retrieve.
body body ListDetail false

Example responses

200 Response

{
  "created": "2019-08-24T14:15:22Z",
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "is_primary": true,
  "last_cleaned_at": "2019-08-24T14:15:22Z",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "created": "2019-08-24T14:15:22Z",
      "id": 0,
      "name": "string",
      "num_contacts": 0,
      "type": null
    }
  ],
  "subscribe_redirect_url": "string",
  "subscribe_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "unsubscribe_url": "string",
  "website": "string",
  "youtube": "string"
}

Responses

Status Meaning Description Schema
200 OK The updated list. ListDetail
400 Bad Request An errors object. Inline
404 Not Found If the email list does not exist. None

Response Schema

createSegment

Code samples

const inputBody = '{
  "list_id": 0,
  "name": "string",
  "predicates": [
    {
      "tag_name": "string",
      "type": "has_tag"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/segments/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/lists/{list_id}/segments/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/lists/{list_id}/segments/', params={

}, headers = headers)

print r.json()

POST /v1/lists/{list_id}/segments/

Create a segment in the email list.

Body parameter

{
  "list_id": 0,
  "name": "string",
  "predicates": [
    {
      "tag_name": "string",
      "type": "has_tag"
    }
  ]
}

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to create a segment in.
body body SegmentCreation true

Example responses

201 Response

{
  "created": "2019-08-24T14:15:22Z",
  "id": 0,
  "name": "string",
  "num_contacts": 0,
  "type": null
}

Responses

Status Meaning Description Schema
201 Created The segment that was created by the call. Segment
400 Bad Request An errors object. Inline
404 Not Found If the email list does not exist. None

Response Schema

getSubscribersOnList

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/subscribers/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/lists/{list_id}/subscribers/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/lists/{list_id}/subscribers/', params={

}, headers = headers)

print r.json()

GET /v1/lists/{list_id}/subscribers/

Retrieve subscribers on a list.

Parameters

Name In Type Required Description
list_id path integer true ID of the email list.
limit query integer false Limits the result to given count.

Example responses

200 Response

[
  {
    "custom": null,
    "email": "user@example.com",
    "first_name": "string",
    "force_subscribe": true,
    "last_name": "string",
    "name": "string",
    "phone": "string",
    "subscribed": "2019-08-24T14:15:22Z",
    "tags": [
      "string"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK An array of subscribers. Inline
404 Not Found If the email list does not exist. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Subscriber] false none
» custom any false none
» email string(email) true none
» first_name string false none
» force_subscribe boolean false none
» last_name string false none
» name string false none Full name of the contact. Will, if present, take precedence over first_name and last_name.
» phone string false none
» subscribed string(date-time) false read-only
» tags [string] false none

subscribeContactToList

Code samples

const inputBody = '{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "tags": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/subscribers/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/lists/{list_id}/subscribers/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/lists/{list_id}/subscribers/', params={

}, headers = headers)

print r.json()

POST /v1/lists/{list_id}/subscribers/

Subscribe a contact to the email list.

Body parameter

{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "tags": [
    "string"
  ]
}

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to subscribe to.
body body Subscriber true

Example responses

201 Response

{
  "added": "2019-08-24T14:15:22Z",
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-08-24T14:15:22Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-08-24T14:15:22Z"
    }
  ],
  "name": "string",
  "phone": "string",
  "status": "a",
  "status_changed": "2019-08-24T14:15:22Z",
  "tags": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
201 Created The full contact as updated/added by the call. Contact
400 Bad Request An errors object. Inline
404 Not Found If the email list does not exist. None

Response Schema

importSubscribersToList

Code samples

const inputBody = 'email,name
john@example.com,John Smith
';
const headers = {
  'Content-Type':'text/csv',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/subscribers/import/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'text/csv',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/lists/{list_id}/subscribers/import/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'text/csv',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/lists/{list_id}/subscribers/import/', params={

}, headers = headers)

print r.json()

POST /v1/lists/{list_id}/subscribers/import/

Subscribe contacts to the email list.

Body parameter

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to subscribe to.
body body string true

Example responses

200 Response

{
  "num_contacts": 0
}

Responses

Status Meaning Description Schema
200 OK The import result. ImportResult
400 Bad Request An errors object. Inline
404 Not Found If the email list does not exist. None

Response Schema

unsubscribeContactOnListByEmail

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/subscribers/{email}/',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/api.mailmojo.no/v1/lists/{list_id}/subscribers/{email}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/api.mailmojo.no/v1/lists/{list_id}/subscribers/{email}/', params={

}, headers = headers)

print r.json()

DELETE /v1/lists/{list_id}/subscribers/{email}/

Unsubscribe a contact.

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to unsubscribe from.
email path string true Email address of the contact to unsubscribe.

Example responses

200 Response

{
  "added": "2019-08-24T14:15:22Z",
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-08-24T14:15:22Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-08-24T14:15:22Z"
    }
  ],
  "name": "string",
  "phone": "string",
  "status": "a",
  "status_changed": "2019-08-24T14:15:22Z",
  "tags": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK The full contact after the unsubscription. Contact
404 Not Found If the email list doesn’t exist or the contact isn’t subscribed to the email list. None

getSubscriberOnListByEmail

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/subscribers/{email}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/lists/{list_id}/subscribers/{email}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/lists/{list_id}/subscribers/{email}/', params={

}, headers = headers)

print r.json()

GET /v1/lists/{list_id}/subscribers/{email}/

Retrieve a subscriber.

Parameters

Name In Type Required Description
list_id path integer true ID of the email list to retrieve the subscriber from.
email path string true Email address of the contact to retrieve.

Example responses

200 Response

{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "subscribed": "2019-08-24T14:15:22Z",
  "tags": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK The subscriber. Subscriber
404 Not Found If the email list doesn’t exist or the contact isn’t subscribed to the email list. None

getUnsubscribedOnList

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/lists/{list_id}/unsubscribed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/lists/{list_id}/unsubscribed/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/lists/{list_id}/unsubscribed/', params={

}, headers = headers)

print r.json()

GET /v1/lists/{list_id}/unsubscribed/

Retrieve unsubscribed contacts on a list.

Parameters

Name In Type Required Description
list_id path integer true ID of the email list.
limit query integer false Limits the result to given count.

Example responses

200 Response

[
  {
    "added": "2019-08-24T14:15:22Z",
    "custom": null,
    "email": "user@example.com",
    "first_name": "string",
    "last_name": "string",
    "list_associations": [
      {
        "added": "2019-08-24T14:15:22Z",
        "email": "string",
        "list_id": 0,
        "status": "a",
        "status_changed": "2019-08-24T14:15:22Z"
      }
    ],
    "name": "string",
    "phone": "string",
    "status": "a",
    "status_changed": "2019-08-24T14:15:22Z",
    "tags": [
      "string"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK An array of unsubscribed contacts. Inline
404 Not Found If the email list does not exist. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Contact] false none
» added string(date-time) false none
» custom any false none
» email string(email) true none
» first_name string false none
» last_name string false none
» list_associations [ContactList] false none
»» added string(date-time) false none
»» email string true none
»» list_id integer(int32) true none
»» status string false none
»» status_changed string(date-time) false none
» name string false none Full name of the contact. Will, if present, take precedence over first_name and last_name.
» phone string false none
» status string false none
» status_changed string(date-time) false none
» tags [string] false none
Enumerated Values
Property Value
status a
status u
status b
status d
status a
status u
status b
status d

Newsletter

getNewsletters

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/newsletters/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/newsletters/', params={

}, headers = headers)

print r.json()

GET /v1/newsletters/

Retrieve all newsletters.

Parameters

Name In Type Required Description
page query integer false The current page of items (1 indexed).
per_page query integer false The number of items returned per page.
type query string false The type of newsletters to retrieve. Supported options are draft, scheduled and sent.

Example responses

200 Response

{
  "data": [
    {
      "completed": "2019-08-24T14:15:22Z",
      "data": [
        {}
      ],
      "editor_html": "string",
      "html": "string",
      "id": 0,
      "is_aborted": true,
      "is_draft": true,
      "is_in_campaign": true,
      "is_scheduled": true,
      "is_sending": true,
      "is_sent": true,
      "list": {
        "created": "2019-08-24T14:15:22Z",
        "data_retention": null,
        "description": "string",
        "enable_link_proxy": true,
        "enable_recaptcha": true,
        "enable_stats_filter": true,
        "facebook": "string",
        "from_email": "user@example.com",
        "from_name": "string",
        "id": 0,
        "instagram": "string",
        "is_primary": true,
        "last_cleaned_at": "2019-08-24T14:15:22Z",
        "linkedin": "string",
        "name": "string",
        "pinterest": "string",
        "subscribe_redirect_url": "string",
        "subscribe_url": "string",
        "twitter": "string",
        "unsubscribe_cascades": true,
        "unsubscribe_redirect_url": "string",
        "unsubscribe_url": "string",
        "website": "string",
        "youtube": "string"
      },
      "meta": {
        "next_page": 0,
        "page": 0,
        "per_page": 0,
        "prev_page": 0,
        "total": 0
      },
      "num_recipients": 0,
      "plain": "string",
      "preview_text": "string",
      "saved": "2019-08-24T14:15:22Z",
      "screenshot_url": null,
      "segments": [
        {
          "id": 0,
          "name": "string"
        }
      ],
      "started": "2019-08-24T14:15:22Z",
      "statistics": {
        "bounce_rate": 0.1,
        "click_rate": 0.1,
        "num_shares": 0,
        "open_rate": 0.1
      },
      "subject": "string",
      "template_id": 0,
      "utm_campaign": "string",
      "view_url": null
    }
  ],
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK An array of newsletters. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data [NewsletterDetail] false none
»» completed string(date-time) false read-only
»» data [Schema] false none
»» editor_html string false read-only
»» html string false none
»» id integer(int32) false read-only
»» is_aborted boolean false read-only
»» is_draft boolean false read-only
»» is_in_campaign boolean false read-only
»» is_scheduled boolean false read-only
»» is_sending boolean false read-only
»» is_sent boolean false read-only
»» list List false none
»»» created string(date-time) false read-only
»»» data_retention any false none If set (to a number of days), automatic cleanup of inactive contacts will be enabled and performed every X days.
»»» description string false none
»»» enable_link_proxy boolean false none Beta feature: Whether to block robots from following links in newsletters.
»»» enable_recaptcha boolean false none Whether to enable reCAPTCHA to block spam subscriptions from the default subscribe form.
»»» enable_stats_filter boolean false none Beta feature: Whether to block robots that trigger opens and clicks from being tracked in reports.
»»» facebook string(url)¦null false none
»»» from_email string(email) true none
»»» from_name string true none
»»» id integer(int32) false read-only
»»» instagram string¦null false none
»»» is_primary boolean false none Whether this is the primary email list on the account.
»»» last_cleaned_at string(date-time) false read-only When cleanup of inactive contacts were last performed.
»»» linkedin string(url)¦null false none
»»» name string true none
»»» pinterest string¦null false none
»»» subscribe_redirect_url string(url)¦null false none
»»» subscribe_url string false read-only
»»» twitter string¦null false none
»»» unsubscribe_cascades boolean false none
»»» unsubscribe_redirect_url string(url)¦null false none
»»» unsubscribe_url string false read-only
»»» website string(url)¦null false none
»»» youtube string¦null false none
»» meta PageMeta false none
»»» next_page integer(int32) false none
»»» page integer(int32) false none
»»» per_page integer(int32) false none
»»» prev_page integer(int32) false none
»»» total integer(int32) false none
»» num_recipients integer(int32) false read-only
»» plain string false none
»» preview_text string false none
»» saved string(date-time) false read-only
»» screenshot_url any false none
»» segments [MinimalSegment] false none
»»» id integer(int32) false read-only
»»» name string false read-only
»» started string(date-time) false read-only
»» statistics Statistics false none
»»» bounce_rate number(float) false none
»»» click_rate number(float) false none
»»» num_shares integer(int32) false none
»»» open_rate number(float) false none
»» subject string false none
»» template_id integer(int32) false none
»» utm_campaign string false none
»» view_url any false none
» meta PageMeta false none

createNewsletter

Code samples

const inputBody = '{
  "html": null,
  "html_url": "string",
  "list_id": 0,
  "preview_text": "string",
  "segment_ids": [
    null
  ],
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/newsletters/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/newsletters/', params={

}, headers = headers)

print r.json()

POST /v1/newsletters/

Create a newsletter draft.

Body parameter

{
  "html": null,
  "html_url": "string",
  "list_id": 0,
  "preview_text": "string",
  "segment_ids": [
    null
  ],
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string"
}

Parameters

Name In Type Required Description
body body NewsletterCreation true

Example responses

201 Response

{
  "completed": "2019-08-24T14:15:22Z",
  "data": [
    {}
  ],
  "editor_html": "string",
  "html": "string",
  "id": 0,
  "is_aborted": true,
  "is_draft": true,
  "is_in_campaign": true,
  "is_scheduled": true,
  "is_sending": true,
  "is_sent": true,
  "list": {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  },
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  },
  "num_recipients": 0,
  "plain": "string",
  "preview_text": "string",
  "saved": "2019-08-24T14:15:22Z",
  "screenshot_url": null,
  "segments": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "started": "2019-08-24T14:15:22Z",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_shares": 0,
    "open_rate": 0.1
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": null
}

Responses

Status Meaning Description Schema
201 Created The newsletter draft created. NewsletterDetail
400 Bad Request An errors object. Inline

Response Schema

getNewsletterById

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/{newsletter_id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/newsletters/{newsletter_id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/newsletters/{newsletter_id}/', params={

}, headers = headers)

print r.json()

GET /v1/newsletters/{newsletter_id}/

Retrieve a newsletter by id.

Parameters

Name In Type Required Description
newsletter_id path integer true ID of the newsletter to retrieve.

Example responses

200 Response

{
  "completed": "2019-08-24T14:15:22Z",
  "data": [
    {}
  ],
  "editor_html": "string",
  "html": "string",
  "id": 0,
  "is_aborted": true,
  "is_draft": true,
  "is_in_campaign": true,
  "is_scheduled": true,
  "is_sending": true,
  "is_sent": true,
  "list": {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  },
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  },
  "num_recipients": 0,
  "plain": "string",
  "preview_text": "string",
  "saved": "2019-08-24T14:15:22Z",
  "screenshot_url": null,
  "segments": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "started": "2019-08-24T14:15:22Z",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_shares": 0,
    "open_rate": 0.1
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": null
}

Responses

Status Meaning Description Schema
200 OK The newsletter retrieved. NewsletterDetail
404 Not Found If the newsletter does not exist. None

updateNewsletter

Code samples

const inputBody = '{
  "html": null,
  "html_url": "string",
  "list_id": 0,
  "preview_text": "string",
  "segment_ids": [
    null
  ],
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/{newsletter_id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/newsletters/{newsletter_id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/newsletters/{newsletter_id}/', params={

}, headers = headers)

print r.json()

PATCH /v1/newsletters/{newsletter_id}/

Update a newsletter draft partially.

Body parameter

{
  "html": null,
  "html_url": "string",
  "list_id": 0,
  "preview_text": "string",
  "segment_ids": [
    null
  ],
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string"
}

Parameters

Name In Type Required Description
id path integer true ID of the newsletter to update.
body body NewsletterUpdate false

Example responses

200 Response

{
  "completed": "2019-08-24T14:15:22Z",
  "data": [
    {}
  ],
  "editor_html": "string",
  "html": "string",
  "id": 0,
  "is_aborted": true,
  "is_draft": true,
  "is_in_campaign": true,
  "is_scheduled": true,
  "is_sending": true,
  "is_sent": true,
  "list": {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  },
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  },
  "num_recipients": 0,
  "plain": "string",
  "preview_text": "string",
  "saved": "2019-08-24T14:15:22Z",
  "screenshot_url": null,
  "segments": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "started": "2019-08-24T14:15:22Z",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_shares": 0,
    "open_rate": 0.1
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": null
}

Responses

Status Meaning Description Schema
200 OK The updated newsletter. NewsletterDetail
400 Bad Request An errors object. Inline
404 Not Found If the newsletter doesn’t exist or is not a draft. None

Response Schema

cancelNewsletter

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/{newsletter_id}/cancel/',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','/api.mailmojo.no/v1/newsletters/{newsletter_id}/cancel/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('/api.mailmojo.no/v1/newsletters/{newsletter_id}/cancel/', params={

}, headers = headers)

print r.json()

PUT /v1/newsletters/{newsletter_id}/cancel/

Cancel a newsletter.

Parameters

Name In Type Required Description
newsletter_id path integer true ID of the newsletter to retrieve.

Example responses

200 Response

{
  "completed": "2019-08-24T14:15:22Z",
  "data": [
    {}
  ],
  "editor_html": "string",
  "html": "string",
  "id": 0,
  "is_aborted": true,
  "is_draft": true,
  "is_in_campaign": true,
  "is_scheduled": true,
  "is_sending": true,
  "is_sent": true,
  "list": {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  },
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  },
  "num_recipients": 0,
  "plain": "string",
  "preview_text": "string",
  "saved": "2019-08-24T14:15:22Z",
  "screenshot_url": null,
  "segments": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "started": "2019-08-24T14:15:22Z",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_shares": 0,
    "open_rate": 0.1
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": null
}

Responses

Status Meaning Description Schema
200 OK The cancelled newsletter. NewsletterDetail
400 Bad Request An errors object. Inline

Response Schema

sendNewsletter

Code samples

const inputBody = '{
  "send_date": "2019-08-24T14:15:22Z"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/{newsletter_id}/send/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','/api.mailmojo.no/v1/newsletters/{newsletter_id}/send/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('/api.mailmojo.no/v1/newsletters/{newsletter_id}/send/', params={

}, headers = headers)

print r.json()

PUT /v1/newsletters/{newsletter_id}/send/

Send a newsletter.

Body parameter

{
  "send_date": "2019-08-24T14:15:22Z"
}

Parameters

Name In Type Required Description
newsletter_id path integer true ID of the newsletter to retrieve.
body body NewsletterSend false

Example responses

200 Response

{
  "completed": "2019-08-24T14:15:22Z",
  "data": [
    {}
  ],
  "editor_html": "string",
  "html": "string",
  "id": 0,
  "is_aborted": true,
  "is_draft": true,
  "is_in_campaign": true,
  "is_scheduled": true,
  "is_sending": true,
  "is_sent": true,
  "list": {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  },
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  },
  "num_recipients": 0,
  "plain": "string",
  "preview_text": "string",
  "saved": "2019-08-24T14:15:22Z",
  "screenshot_url": null,
  "segments": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "started": "2019-08-24T14:15:22Z",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_shares": 0,
    "open_rate": 0.1
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": null
}

Responses

Status Meaning Description Schema
200 OK The sent newsletter. NewsletterDetail
400 Bad Request An errors object. Inline

Response Schema

testNewsletter

Code samples

const inputBody = '{
  "emails": [
    "user@example.com"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/newsletters/{newsletter_id}/send_test/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/newsletters/{newsletter_id}/send_test/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/newsletters/{newsletter_id}/send_test/', params={

}, headers = headers)

print r.json()

POST /v1/newsletters/{newsletter_id}/send_test/

Send a test newsletter.

Body parameter

{
  "emails": [
    "user@example.com"
  ]
}

Parameters

Name In Type Required Description
newsletter_id path integer true ID of the newsletter to retrieve.
body body NewsletterSendTest true

Example responses

400 Response

{}

Responses

Status Meaning Description Schema
204 No Content The test newsletter is sent. None
400 Bad Request An errors object. Inline

Response Schema

Page

getPages

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/pages/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/pages/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/pages/', params={

}, headers = headers)

print r.json()

GET /v1/pages/

Retrieve all landing pages.

Example responses

200 Response

[
  {
    "config": {},
    "confirmation_html": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "domain_id": 0,
    "editor_confirmation_html": "string",
    "editor_html": "string",
    "expired_at": "2019-08-24T14:15:22Z",
    "final_confirmation_html": "string",
    "final_html": "string",
    "form_id": 0,
    "html": "string",
    "id": 0,
    "lid": 0,
    "name": "string",
    "public_url": "string",
    "published_at": "2019-08-24T14:15:22Z",
    "slug": "string",
    "styles": "string",
    "subscribe_tags": [
      "string"
    ],
    "template_id": 0,
    "updated_at": "2019-08-24T14:15:22Z"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of landing pages. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Page] false none
» config object true none
» confirmation_html string true none
» created_at string(date-time) false read-only
» domain_id integer(int32)¦null false none
» editor_confirmation_html string false read-only
» editor_html string false read-only
» expired_at string(date-time) false read-only
» final_confirmation_html string false read-only
» final_html string false read-only
» form_id integer(int32) false read-only
» html string true none
» id integer(int32) false read-only
» lid integer(int32) true none
» name string true none
» public_url string false read-only
» published_at string(date-time) false read-only
» slug string true none
» styles string false read-only
» subscribe_tags [string] false none
» template_id integer(int32) false read-only
» updated_at string(date-time) false read-only

getPageById

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/pages/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/pages/{id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/pages/{id}/', params={

}, headers = headers)

print r.json()

GET /v1/pages/{id}/

Retrieve a landing page.

Parameters

Name In Type Required Description
id path integer true ID of the landing page to retrieve.

Example responses

200 Response

{
  "config": {},
  "confirmation_html": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "domain_id": 0,
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "final_confirmation_html": "string",
  "final_html": "string",
  "form_id": 0,
  "html": "string",
  "id": 0,
  "lid": 0,
  "name": "string",
  "public_url": "string",
  "published_at": "2019-08-24T14:15:22Z",
  "slug": "string",
  "styles": "string",
  "subscribe_tags": [
    "string"
  ],
  "template_id": 0,
  "updated_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK The landing page retrieved. Page
404 Not Found If the page does not exist. None

updatePage

Code samples

const inputBody = '{
  "config": {},
  "confirmation_html": "string",
  "domain_id": 0,
  "html": "string",
  "lid": 0,
  "name": "string",
  "slug": "string",
  "subscribe_tags": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/pages/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/pages/{id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/pages/{id}/', params={

}, headers = headers)

print r.json()

PATCH /v1/pages/{id}/

Update a landing page partially.

Body parameter

{
  "config": {},
  "confirmation_html": "string",
  "domain_id": 0,
  "html": "string",
  "lid": 0,
  "name": "string",
  "slug": "string",
  "subscribe_tags": [
    "string"
  ]
}

Parameters

Name In Type Required Description
id path integer true ID of the landing page to update.
body body Page false

Example responses

200 Response

{
  "config": {},
  "confirmation_html": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "domain_id": 0,
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "final_confirmation_html": "string",
  "final_html": "string",
  "form_id": 0,
  "html": "string",
  "id": 0,
  "lid": 0,
  "name": "string",
  "public_url": "string",
  "published_at": "2019-08-24T14:15:22Z",
  "slug": "string",
  "styles": "string",
  "subscribe_tags": [
    "string"
  ],
  "template_id": 0,
  "updated_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK The updated landing page. Page
400 Bad Request An errors object. Inline
404 Not Found If the landing page does not exist. None

Response Schema

trackPageView

Code samples

const inputBody = '{
  "page_id": 0,
  "user_agent": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/pages/{id}/track/view/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api.mailmojo.no/v1/pages/{id}/track/view/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/api.mailmojo.no/v1/pages/{id}/track/view/', params={

}, headers = headers)

print r.json()

PATCH /v1/pages/{id}/track/view/

Track a view of a landing page.

Body parameter

{
  "page_id": 0,
  "user_agent": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}

Parameters

Name In Type Required Description
id path integer true ID of the page to track view of.
body body TrackPageView true

Example responses

201 Response

{
  "id": 0,
  "page_id": 0,
  "user_agent": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}

Responses

Status Meaning Description Schema
201 Created The tracked view. TrackPageView
400 Bad Request An errors object. Inline
404 Not Found If the page does not exist. None

Response Schema

Template

getTemplates

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/templates/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/templates/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/templates/', params={

}, headers = headers)

print r.json()

GET /v1/templates/

Retrieve all templates.

Example responses

200 Response

[
  {
    "categories": [
      {
        "name": "string"
      }
    ],
    "data": {},
    "description": "string",
    "id": 0,
    "is_editable": true,
    "name": "string",
    "preview_url": null,
    "product_category": "string",
    "product_description": "string",
    "product_id": [
      null
    ],
    "product_type": "string",
    "screenshot_url": null,
    "settings": {},
    "slug": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of templates. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Template] false none
» categories [Category] false none
»» name string false none
» data object false none
» description string false none
» id integer(int32) false none
» is_editable boolean false none
» name string false none
» preview_url any false none
» product_category string false none
» product_description string false none
» product_id [any] false none
» product_type string false none
» screenshot_url any false none
» settings object false none
» slug string false none

getAvailableWebComponents

Code samples


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/templates/web_components/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api.mailmojo.no/v1/templates/web_components/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api.mailmojo.no/v1/templates/web_components/', params={

}, headers = headers)

print r.json()

GET /v1/templates/web_components/

Retrieve all web components.

Example responses

200 Response

[
  {
    "attributes": [
      {}
    ],
    "data": {
      "element": "string",
      "style": "string",
      "template": "string"
    },
    "name": "string",
    "slots": [
      {}
    ],
    "tag": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK An array of web components. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [WebComponent] false none
» attributes [object] false none
» data WebComponentData true none
»» element string true none
»» style string true none
»» template string true none
» name string true none
» slots [object] false none
» tag string true none

Webhook

createWebhook

Code samples

const inputBody = '{
  "callback_url": "string",
  "is_enabled": true,
  "topic": "contacts/subscribed"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/webhooks/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api.mailmojo.no/v1/webhooks/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api.mailmojo.no/v1/webhooks/', params={

}, headers = headers)

print r.json()

POST /v1/webhooks/

Create a webhook.

Body parameter

{
  "callback_url": "string",
  "is_enabled": true,
  "topic": "contacts/subscribed"
}

Parameters

Name In Type Required Description
body body WebhookCreation true

Example responses

201 Response

{
  "callback_url": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "id": 0,
  "integration_id": "string",
  "is_enabled": true,
  "secret": "string",
  "topic": "contacts/subscribed"
}

Responses

Status Meaning Description Schema
201 Created The webhook created. WebhookCreation
400 Bad Request An errors object. Inline

Response Schema

deleteWebhook

Code samples


const headers = {
  'Authorization':'Bearer {access-token}'

};

fetch('/api.mailmojo.no/v1/webhooks/{id}/',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


$headers = array(
    'Authorization' => 'Bearer {access-token}',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/api.mailmojo.no/v1/webhooks/{id}/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/api.mailmojo.no/v1/webhooks/{id}/', params={

}, headers = headers)

print r.json()

DELETE /v1/webhooks/{id}/

Delete a webhook.

Parameters

Name In Type Required Description
id path integer true ID of the webhook.

Responses

Status Meaning Description Schema
204 No Content The webhook was deleted successfully. None
404 Not Found The webhook doesn’t exist. None

Schemas

AddFormSubscriber

{
  "contact": {
    "custom": null,
    "email": "user@example.com",
    "first_name": "string",
    "last_name": "string",
    "name": "string",
    "phone": "string",
    "tags": [
      "string"
    ]
  },
  "page_view_id": null,
  "view_id": 0
}

Properties

Name Type Required Restrictions Description
contact BaseContact true none
page_view_id integer(int32)¦null false none
view_id integer(int32) true none

BaseContact

{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "tags": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
custom any false none
email string(email) true none
first_name string false none
last_name string false none
name string false none Full name of the contact. Will, if present, take precedence over first_name and last_name.
phone string false none
tags [string] false none

CampaignDetail

{
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "name": "string",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_recipients": 0,
    "open_rate": 0.1
  },
  "utm_campaign": "string"
}

Properties

Name Type Required Restrictions Description
from_email string(email) true none
from_name string true none
id integer(int32) false read-only
name string true none
statistics CampaignStatistics false none
utm_campaign string false none

CampaignStatistics

{
  "bounce_rate": 0.1,
  "click_rate": 0.1,
  "num_recipients": 0,
  "open_rate": 0.1
}

Properties

Name Type Required Restrictions Description
bounce_rate number(float) false none
click_rate number(float) false none
num_recipients integer(int32) false none
open_rate number(float) false none

Category

{
  "name": "string"
}

Properties

Name Type Required Restrictions Description
name string false none

Contact

{
  "added": "2019-08-24T14:15:22Z",
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-08-24T14:15:22Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-08-24T14:15:22Z"
    }
  ],
  "name": "string",
  "phone": "string",
  "status": "a",
  "status_changed": "2019-08-24T14:15:22Z",
  "tags": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
added string(date-time) false none
custom any false none
email string(email) true none
first_name string false none
last_name string false none
list_associations [ContactList] false none
name string false none Full name of the contact. Will, if present, take precedence over first_name and last_name.
phone string false none
status string false none
status_changed string(date-time) false none
tags [string] false none

Enumerated Values

Property Value
status a
status u
status b
status d

ContactList

{
  "added": "2019-08-24T14:15:22Z",
  "email": "string",
  "list_id": 0,
  "status": "a",
  "status_changed": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
added string(date-time) false none
email string true none
list_id integer(int32) true none
status string false none
status_changed string(date-time) false none

Enumerated Values

Property Value
status a
status u
status b
status d

Domain

{
  "created_at": "2019-08-24T14:15:22Z",
  "domain": "string",
  "has_authentication": true,
  "id": 0,
  "is_confirmed": true,
  "is_dmarc_passed": true,
  "is_dns_verified": true,
  "is_free_domain": false,
  "is_spf_dkim_passed": true,
  "spf_status": null,
  "type": "string"
}

Properties

Name Type Required Restrictions Description
created_at string(date-time) false read-only
domain string true none
has_authentication boolean false read-only
id integer(int32) false read-only
is_confirmed boolean false read-only
is_dmarc_passed boolean false read-only
is_dns_verified boolean false read-only
is_free_domain any false none
is_spf_dkim_passed boolean false read-only
spf_status any false read-only
type string false read-only

Embed

{
  "options": {},
  "session_type": "newsletters",
  "user_ip": "string"
}

Properties

Name Type Required Restrictions Description
options EmbedOptions false none
session_type string true none
user_ip string true none

Enumerated Values

Property Value
session_type newsletters

EmbedOptions

{
  "enable_dev_features": true,
  "enable_newsletters_index": true,
  "locale": "en_US"
}

Properties

Name Type Required Restrictions Description
enable_dev_features boolean false none
enable_newsletters_index boolean false none
locale string false none

Enumerated Values

Property Value
locale en_US
locale nb_NO
locale sv_SE

Form

{
  "config": {},
  "confirmation_html": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "final_confirmation_html": "string",
  "final_html": "string",
  "html": "string",
  "id": 0,
  "lid": 0,
  "name": "string",
  "public_url": "string",
  "published_at": "2019-08-24T14:15:22Z",
  "styles": "string",
  "template_id": 0,
  "trigger": [
    {
      "rules": [
        {
          "trigger_type": "string",
          "value": 0
        }
      ]
    }
  ],
  "type": "embedded",
  "updated_at": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
config object true none
confirmation_html string true none
created_at string(date-time) false read-only
editor_confirmation_html string false read-only
editor_html string false read-only
expired_at string(date-time) false read-only
final_confirmation_html string false read-only
final_html string false read-only
html string true none
id integer(int32) false read-only
lid integer(int32) true none
name string true none
public_url string(url) false read-only
published_at string(date-time) false read-only
styles string false read-only
template_id integer(int32) false none
trigger [Trigger] false none
type string true none
updated_at string(date-time) false read-only

Enumerated Values

Property Value
type embedded
type subscribe
type subscribe_popup
type unsubscribe
type profile
type forward

FormConversion

{
  "converted_at": "2019-08-24T14:15:22Z",
  "id": 0
}

Properties

Name Type Required Restrictions Description
converted_at string(date-time) false read-only
id integer(int32) false read-only

HistoricalContactsStats

{
  "added": 0,
  "bounced": 0,
  "date": "2019-08-24",
  "deleted": 0,
  "sum": 0,
  "unsubscribed": 0
}

Properties

Name Type Required Restrictions Description
added integer(int32) false none
bounced integer(int32) false none
date string(date) false none
deleted integer(int32) false none
sum integer(int32) false none
unsubscribed integer(int32) false none

ImportResult

{
  "num_contacts": 0
}

Properties

Name Type Required Restrictions Description
num_contacts integer(int32) true none

List

{
  "created": "2019-08-24T14:15:22Z",
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "is_primary": true,
  "last_cleaned_at": "2019-08-24T14:15:22Z",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "subscribe_redirect_url": "string",
  "subscribe_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "unsubscribe_url": "string",
  "website": "string",
  "youtube": "string"
}

Properties

Name Type Required Restrictions Description
created string(date-time) false read-only
data_retention any false none If set (to a number of days), automatic cleanup of inactive contacts will be enabled and performed every X days.
description string false none
enable_link_proxy boolean false none Beta feature: Whether to block robots from following links in newsletters.
enable_recaptcha boolean false none Whether to enable reCAPTCHA to block spam subscriptions from the default subscribe form.
enable_stats_filter boolean false none Beta feature: Whether to block robots that trigger opens and clicks from being tracked in reports.
facebook string(url)¦null false none
from_email string(email) true none
from_name string true none
id integer(int32) false read-only
instagram string¦null false none
is_primary boolean false none Whether this is the primary email list on the account.
last_cleaned_at string(date-time) false read-only When cleanup of inactive contacts were last performed.
linkedin string(url)¦null false none
name string true none
pinterest string¦null false none
subscribe_redirect_url string(url)¦null false none
subscribe_url string false read-only
twitter string¦null false none
unsubscribe_cascades boolean false none
unsubscribe_redirect_url string(url)¦null false none
unsubscribe_url string false read-only
website string(url)¦null false none
youtube string¦null false none

ListDetail

{
  "created": "2019-08-24T14:15:22Z",
  "data_retention": null,
  "description": "string",
  "enable_link_proxy": true,
  "enable_recaptcha": true,
  "enable_stats_filter": true,
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "is_primary": true,
  "last_cleaned_at": "2019-08-24T14:15:22Z",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "created": "2019-08-24T14:15:22Z",
      "id": 0,
      "name": "string",
      "num_contacts": 0,
      "type": null
    }
  ],
  "subscribe_redirect_url": "string",
  "subscribe_url": "string",
  "twitter": "string",
  "unsubscribe_cascades": true,
  "unsubscribe_redirect_url": "string",
  "unsubscribe_url": "string",
  "website": "string",
  "youtube": "string"
}

Properties

Name Type Required Restrictions Description
created string(date-time) false read-only
data_retention any false none If set (to a number of days), automatic cleanup of inactive contacts will be enabled and performed every X days.
description string false none
enable_link_proxy boolean false none Beta feature: Whether to block robots from following links in newsletters.
enable_recaptcha boolean false none Whether to enable reCAPTCHA to block spam subscriptions from the default subscribe form.
enable_stats_filter boolean false none Beta feature: Whether to block robots that trigger opens and clicks from being tracked in reports.
facebook string(url)¦null false none
from_email string(email) true none
from_name string true none
id integer(int32) false read-only
instagram string¦null false none
is_primary boolean false none Whether this is the primary email list on the account.
last_cleaned_at string(date-time) false read-only When cleanup of inactive contacts were last performed.
linkedin string(url)¦null false none
name string true none
pinterest string¦null false none
segments [Segment] false none
subscribe_redirect_url string(url)¦null false none
subscribe_url string false read-only
twitter string¦null false none
unsubscribe_cascades boolean false none
unsubscribe_redirect_url string(url)¦null false none
unsubscribe_url string false read-only
website string(url)¦null false none
youtube string¦null false none

MinimalSegment

{
  "id": 0,
  "name": "string"
}

Properties

Name Type Required Restrictions Description
id integer(int32) false read-only
name string false read-only

NewsletterCreation

{
  "html": null,
  "html_url": "string",
  "list_id": 0,
  "preview_text": "string",
  "segment_ids": [
    null
  ],
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string"
}

Properties

Name Type Required Restrictions Description
html any false none
html_url string(url) false none
list_id integer(int32) true none
preview_text string¦null false none
segment_ids [any] false none
subject string true none
template_id integer(int32) false none
utm_campaign string¦null false none

NewsletterDetail

{
  "completed": "2019-08-24T14:15:22Z",
  "data": [
    {}
  ],
  "editor_html": "string",
  "html": "string",
  "id": 0,
  "is_aborted": true,
  "is_draft": true,
  "is_in_campaign": true,
  "is_scheduled": true,
  "is_sending": true,
  "is_sent": true,
  "list": {
    "created": "2019-08-24T14:15:22Z",
    "data_retention": null,
    "description": "string",
    "enable_link_proxy": true,
    "enable_recaptcha": true,
    "enable_stats_filter": true,
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "is_primary": true,
    "last_cleaned_at": "2019-08-24T14:15:22Z",
    "linkedin": "string",
    "name": "string",
    "pinterest": "string",
    "subscribe_redirect_url": "string",
    "subscribe_url": "string",
    "twitter": "string",
    "unsubscribe_cascades": true,
    "unsubscribe_redirect_url": "string",
    "unsubscribe_url": "string",
    "website": "string",
    "youtube": "string"
  },
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  },
  "num_recipients": 0,
  "plain": "string",
  "preview_text": "string",
  "saved": "2019-08-24T14:15:22Z",
  "screenshot_url": null,
  "segments": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "started": "2019-08-24T14:15:22Z",
  "statistics": {
    "bounce_rate": 0.1,
    "click_rate": 0.1,
    "num_shares": 0,
    "open_rate": 0.1
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": null
}

Properties

Name Type Required Restrictions Description
completed string(date-time) false read-only
data [Schema] false none
editor_html string false read-only
html string false none
id integer(int32) false read-only
is_aborted boolean false read-only
is_draft boolean false read-only
is_in_campaign boolean false read-only
is_scheduled boolean false read-only
is_sending boolean false read-only
is_sent boolean false read-only
list List false none
meta PageMeta false none
num_recipients integer(int32) false read-only
plain string false none
preview_text string false none
saved string(date-time) false read-only
screenshot_url any false none
segments [MinimalSegment] false none
started string(date-time) false read-only
statistics Statistics false none
subject string false none
template_id integer(int32) false none
utm_campaign string false none
view_url any false none

NewsletterSend

{
  "send_date": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
send_date string(date-time) false none

NewsletterSendTest

{
  "emails": [
    "user@example.com"
  ]
}

Properties

Name Type Required Restrictions Description
emails [string] true none

NewsletterUpdate

{
  "html": null,
  "html_url": "string",
  "list_id": 0,
  "preview_text": "string",
  "segment_ids": [
    null
  ],
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string"
}

Properties

Name Type Required Restrictions Description
html any false none
html_url string(url) false none
list_id integer(int32) true none
preview_text string¦null false none
segment_ids [any] false none
subject string false none
template_id integer(int32) false none
utm_campaign string¦null false none

Page

{
  "config": {},
  "confirmation_html": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "domain_id": 0,
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "final_confirmation_html": "string",
  "final_html": "string",
  "form_id": 0,
  "html": "string",
  "id": 0,
  "lid": 0,
  "name": "string",
  "public_url": "string",
  "published_at": "2019-08-24T14:15:22Z",
  "slug": "string",
  "styles": "string",
  "subscribe_tags": [
    "string"
  ],
  "template_id": 0,
  "updated_at": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
config object true none
confirmation_html string true none
created_at string(date-time) false read-only
domain_id integer(int32)¦null false none
editor_confirmation_html string false read-only
editor_html string false read-only
expired_at string(date-time) false read-only
final_confirmation_html string false read-only
final_html string false read-only
form_id integer(int32) false read-only
html string true none
id integer(int32) false read-only
lid integer(int32) true none
name string true none
public_url string false read-only
published_at string(date-time) false read-only
slug string true none
styles string false read-only
subscribe_tags [string] false none
template_id integer(int32) false read-only
updated_at string(date-time) false read-only

PageMeta

{
  "next_page": 0,
  "page": 0,
  "per_page": 0,
  "prev_page": 0,
  "total": 0
}

Properties

Name Type Required Restrictions Description
next_page integer(int32) false none
page integer(int32) false none
per_page integer(int32) false none
prev_page integer(int32) false none
total integer(int32) false none

Schema

{}

Properties

None

Segment

{
  "created": "2019-08-24T14:15:22Z",
  "id": 0,
  "name": "string",
  "num_contacts": 0,
  "type": null
}

Properties

Name Type Required Restrictions Description
created string(date-time) false read-only
id integer(int32) false read-only
name string true none
num_contacts integer(int32) false read-only
type any false read-only

SegmentCreation

{
  "list_id": 0,
  "name": "string",
  "predicates": [
    {
      "tag_name": "string",
      "type": "has_tag"
    }
  ]
}

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none
name string true none
predicates [SegmentTagPredicate] true none

SegmentTagPredicate

{
  "tag_name": "string",
  "type": "has_tag"
}

Properties

Name Type Required Restrictions Description
tag_name string true none
type string true none

Enumerated Values

Property Value
type has_tag
type not_has_tag

Statistics

{
  "bounce_rate": 0.1,
  "click_rate": 0.1,
  "num_shares": 0,
  "open_rate": 0.1
}

Properties

Name Type Required Restrictions Description
bounce_rate number(float) false none
click_rate number(float) false none
num_shares integer(int32) false none
open_rate number(float) false none

Subscriber

{
  "custom": null,
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "string",
  "phone": "string",
  "subscribed": "2019-08-24T14:15:22Z",
  "tags": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
custom any false none
email string(email) true none
first_name string false none
force_subscribe boolean false none
last_name string false none
name string false none Full name of the contact. Will, if present, take precedence over first_name and last_name.
phone string false none
subscribed string(date-time) false read-only
tags [string] false none

Template

{
  "categories": [
    {
      "name": "string"
    }
  ],
  "data": {},
  "description": "string",
  "id": 0,
  "is_editable": true,
  "name": "string",
  "preview_url": null,
  "product_category": "string",
  "product_description": "string",
  "product_id": [
    null
  ],
  "product_type": "string",
  "screenshot_url": null,
  "settings": {},
  "slug": "string"
}

Properties

Name Type Required Restrictions Description
categories [Category] false none
data object false none
description string false none
id integer(int32) false none
is_editable boolean false none
name string false none
preview_url any false none
product_category string false none
product_description string false none
product_id [any] false none
product_type string false none
screenshot_url any false none
settings object false none
slug string false none

TrackFormView

{
  "form_id": 0,
  "id": 0,
  "trigger": {},
  "user_agent": "string",
  "view_url": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}

Properties

Name Type Required Restrictions Description
form_id integer(int32) true none
id integer(int32) false read-only
trigger object true none
user_agent string false none
view_url string(url) true none
visitor_id string(uuid) true none

TrackPageView

{
  "id": 0,
  "page_id": 0,
  "user_agent": "string",
  "visitor_id": "1b5d452e-2897-4f21-ac74-1b59f820ba97"
}

Properties

Name Type Required Restrictions Description
id integer(int32) false read-only
page_id integer(int32) true none
user_agent string false none
visitor_id string(uuid) true none

Trigger

{
  "rules": [
    {
      "trigger_type": "string",
      "value": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
rules [TriggerRule] false none

TriggerRule

{
  "trigger_type": "string",
  "value": 0
}

Properties

Name Type Required Restrictions Description
trigger_type string true none
value integer(int32) false none

User

{
  "address": "string",
  "city": "string",
  "contact_email": "user@example.com",
  "contact_name": "string",
  "created": "2019-08-24T14:15:22Z",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "trial_expires": "2019-08-24",
  "username": "string",
  "zip_code": "string"
}

Properties

Name Type Required Restrictions Description
address string false none
city string false none
contact_email string(email) true none
contact_name string false none
created string(date-time) false read-only
logo object false none
logo_url string(url) false none
name string true none
num_contacts integer(int32) false read-only
partner string false read-only
trial_expires string(date) false read-only
username string false read-only
zip_code string false none

UserCreation

{
  "email": "user@example.com",
  "logo": {},
  "logo_url": "string",
  "name": "string",
  "trial_days": 0,
  "username": "string"
}

Properties

Name Type Required Restrictions Description
email string(email) true none
logo object false none
logo_url string(url) false none
name string true none
trial_days integer(int32) false none
username string true none

WebComponent

{
  "attributes": [
    {}
  ],
  "data": {
    "element": "string",
    "style": "string",
    "template": "string"
  },
  "name": "string",
  "slots": [
    {}
  ],
  "tag": "string"
}

Properties

Name Type Required Restrictions Description
attributes [object] false none
data WebComponentData true none
name string true none
slots [object] false none
tag string true none

WebComponentData

{
  "element": "string",
  "style": "string",
  "template": "string"
}

Properties

Name Type Required Restrictions Description
element string true none
style string true none
template string true none

WebhookCreation

{
  "callback_url": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "id": 0,
  "integration_id": "string",
  "is_enabled": true,
  "secret": "string",
  "topic": "contacts/subscribed"
}

Properties

Name Type Required Restrictions Description
callback_url string(url) true none
created_at string(date-time) false read-only
id integer(int32) false read-only
integration_id string false read-only
is_enabled boolean false none
secret string false read-only
topic string true none

Enumerated Values

Property Value
topic contacts/subscribed
topic contacts/unsubscribed