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 .

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 . 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 <script> element. Inject this HTML into your application view where you'd like, and the JavaScript referred to in the <script> element will take care of setting everything up and keeping it in sync with scroll and view size of your application.

Example use of embed HTML with top offset option

<div></div>

If your application does not display the embed at the top of the page, but rather below a navigation header or similar, you'll want to inform the embed about the offset from the top of the page. This can be done through injecting your own embed container element with a data-offset attribute, as shown to the right.

The <script> element as received from the embed endpoint should be output after this element.

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: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.
forms Manage your forms.
forms:events Track events on 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.
subscribe Add subscribers to email lists.
templates Manage your templates.
templates:read Retrieve your templates

Account

createAccount

Code samples

const inputBody = '{
  "email": "user@example.com",
  "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 /accounts/

Create an account.

Body parameter

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

Parameters

Name In Type Required Description
body body MinimalUser true

Example responses

201 Response

{
  "address": "string",
  "city": "string",
  "contact_email": "user@example.com",
  "contact_name": "string",
  "created": "2019-11-13T08:58:50Z",
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "plan": "string",
  "trial_expires": "2019-11-13",
  "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 /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.

Detailed descriptions

username: 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-11-13T08:58:50Z",
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "plan": "string",
  "trial_expires": "2019-11-13",
  "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 /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-11-13T08:58:50Z",
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "plan": "string",
  "trial_expires": "2019-11-13",
  "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. None

Response Schema

getDomain

Code samples


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

};

fetch('/api.mailmojo.no/v1/domains/{domain}/',
{
  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}/', 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}/', params={

}, headers = headers)

print r.json()

GET /domains/{domain}/

Retrieve domain details and authentication status.

Parameters

Name In Type Required Description
domain path string true

Example responses

200 Response

{
  "created_at": "string",
  "domain": "string",
  "has_authentication": true,
  "is_authentication_valid": true,
  "is_dmarc_passed": true,
  "is_free_domain": true,
  "is_verified": true,
  "spf_status": "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 /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,
    "click_rate": 0,
    "num_recipients": 0,
    "open_rate": 0
  },
  "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 /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-11-13T08:58:50Z",
    "email": "user@example.com",
    "first_name": "string",
    "last_name": "string",
    "list_associations": [
      {
        "added": "2019-11-13T08:58:50Z",
        "email": "string",
        "list_id": 0,
        "status": "a",
        "status_changed": "2019-11-13T08:58:50Z"
      }
    ],
    "name": "string",
    "status": "a",
    "status_changed": "2019-11-13T08:58:50Z",
    "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
» email string(email) true none
» first_name string false none
» last_name string false none
» list_associations [object] 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.
» 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

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 /contacts/{email}/

Retrieve a contact in any list by email.

Example responses

200 Response

{
  "added": "2019-11-13T08:58:50Z",
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-11-13T08:58:50Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-11-13T08:58:50Z"
    }
  ],
  "name": "string",
  "status": "a",
  "status_changed": "2019-11-13T08:58:50Z",
  "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 = '{
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "name": "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 /contacts/{email}/

Update details about a contact.

Body parameter

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

Parameters

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

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK The updated contact. MinimalContact
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 /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 false

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK A JavaScript ````javascript

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); });


```php

$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 /forms/

Retrieve all forms.

Parameters

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

Example responses

200 Response

[
  {
    "config": "string",
    "confirmation_html": "string",
    "created_at": "string",
    "editor_confirmation_html": "string",
    "editor_html": "string",
    "expired_at": "string",
    "fields": "string",
    "final_confirmation_html": "string",
    "final_html": "string",
    "html": "string",
    "id": 0,
    "lid": 0,
    "published_at": "string",
    "template_id": 0,
    "type": "subscribe",
    "updated_at": "string"
  }
]

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 string true none
» confirmation_html string true none
» created_at string false read-only
» editor_confirmation_html string false read-only
» editor_html string false read-only
» expired_at string false read-only
» fields string true none
» 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
» published_at string false read-only
» template_id integer(int32) false none
» type string true none
» updated_at string false read-only
Enumerated Values
Property Value
type subscribe
type subscribe_popup
type unsubscribe
type profile
type forward

updateForm

Code samples


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

};

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

  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('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 = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

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

}, headers = headers)

print r.json()

PATCH /forms/{id}/

Update a form partially.

Parameters

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

Example responses

200 Response

{
  "config": "string",
  "confirmation_html": "string",
  "created_at": "string",
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "string",
  "fields": "string",
  "final_confirmation_html": "string",
  "final_html": "string",
  "html": "string",
  "id": 0,
  "lid": 0,
  "published_at": "string",
  "template_id": 0,
  "type": "subscribe",
  "updated_at": "string"
}

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

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 /lists/

Retrieve all email lists.

Example responses

200 Response

[
  {
    "created": "2019-11-13T08:58:50Z",
    "description": "string",
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "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
» description string false none
» 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
» linkedin string(url)¦null false none
» name string true none
» pinterest string¦null false none
» subscribe_redirect_url string(url)¦null true none
» subscribe_url string false read-only
» twitter string¦null false none
» unsubscribe_cascades boolean false none
» unsubscribe_redirect_url string(url)¦null true none
» unsubscribe_url string false read-only
» website string(url)¦null false none
» youtube string¦null false none

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 /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-11-13T08:58:50Z",
  "description": "string",
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "created": "2019-11-13T08:58:50Z",
      "id": 0,
      "label": "string",
      "name": "string",
      "num_contacts": 0,
      "type": "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 The list retrieved. ListDetail
404 Not Found If the email list does not exist. None

updateList

Code samples


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

};

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

  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('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 = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

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

}, headers = headers)

print r.json()

PATCH /lists/{list_id}/

Update an email list partially.

Parameters

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

Example responses

200 Response

{
  "created": "2019-11-13T08:58:50Z",
  "description": "string",
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "created": "2019-11-13T08:58:50Z",
      "id": 0,
      "label": "string",
      "name": "string",
      "num_contacts": 0,
      "type": "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 The updated list. ListDetail
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 /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.

Example responses

200 Response

[
  {
    "email": "user@example.com",
    "first_name": "string",
    "force_subscribe": true,
    "last_name": "string",
    "name": "string",
    "subscribed": "2019-11-13T08:58:50Z",
    "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
» 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.
» subscribed string(date-time) false read-only
» tags [string] false none

subscribeContactToList

Code samples

const inputBody = '{
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "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 /lists/{list_id}/subscribers/

Subscribe a contact to the email list.

Body parameter

{
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "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 false

Example responses

201 Response

{
  "added": "2019-11-13T08:58:50Z",
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-11-13T08:58:50Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-11-13T08:58:50Z"
    }
  ],
  "name": "string",
  "status": "a",
  "status_changed": "2019-11-13T08:58:50Z",
  "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": "string",
    "name": "string"
  }
]';
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 /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 array[object] false

Example responses

200 Response

{
  "num_contacts": 0,
  "num_ignored": 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 /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-11-13T08:58:50Z",
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-11-13T08:58:50Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-11-13T08:58:50Z"
    }
  ],
  "name": "string",
  "status": "a",
  "status_changed": "2019-11-13T08:58:50Z",
  "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 /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.

Detailed descriptions

list_id: ID of the email list to retrieve the subscriber from.

Example responses

200 Response

{
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "string",
  "subscribed": "2019-11-13T08:58:50Z",
  "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

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 /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".

Detailed descriptions

type: The type of newsletters to retrieve. Supported options are "draft", "scheduled" and "sent".

Example responses

200 Response

{
  "data": [
    {}
  ],
  "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. PaginatedResult

createNewsletter

Code samples

const inputBody = '{
  "html": "string",
  "html_url": "string",
  "list_id": 0,
  "segment_ids": [
    "string"
  ],
  "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 /newsletters/

Create a newsletter draft.

Body parameter

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

Parameters

Name In Type Required Description
body body NewsletterCreation false

Example responses

201 Response

{
  "completed": "2019-11-13T08:58:50Z",
  "data": [
    {}
  ],
  "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-11-13T08:58:50Z",
    "description": "string",
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "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",
  "saved": "2019-11-13T08:58:50Z",
  "screenshot_url": "string",
  "segments": [
    {
      "id": 0,
      "label": "string",
      "name": "string"
    }
  ],
  "started": "2019-11-13T08:58:50Z",
  "statistics": {
    "bounce_rate": 0,
    "click_rate": 0,
    "num_shares": 0,
    "open_rate": 0
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": "string"
}

Responses

Status Meaning Description Schema
201 Created The newsletter draft created. Newsletter
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 /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-11-13T08:58:50Z",
  "data": [
    {}
  ],
  "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-11-13T08:58:50Z",
    "description": "string",
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "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",
  "saved": "2019-11-13T08:58:50Z",
  "screenshot_url": "string",
  "segments": [
    {
      "id": 0,
      "label": "string",
      "name": "string"
    }
  ],
  "started": "2019-11-13T08:58:50Z",
  "statistics": {
    "bounce_rate": 0,
    "click_rate": 0,
    "num_shares": 0,
    "open_rate": 0
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": "string"
}

Responses

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

sendNewsletter

Code samples

const inputBody = '{
  "send_date": "2019-11-13T09:58:50.223175+01:00"
}';
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 /newsletters/{newsletter_id}/send/

Send a newsletter.

Body parameter

{
  "send_date": "2019-11-13T09:58:50.223175+01:00"
}

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-11-13T08:58:50Z",
  "data": [
    {}
  ],
  "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-11-13T08:58:50Z",
    "description": "string",
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "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",
  "saved": "2019-11-13T08:58:50Z",
  "screenshot_url": "string",
  "segments": [
    {
      "id": 0,
      "label": "string",
      "name": "string"
    }
  ],
  "started": "2019-11-13T08:58:50Z",
  "statistics": {
    "bounce_rate": 0,
    "click_rate": 0,
    "num_shares": 0,
    "open_rate": 0
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": "string"
}

Responses

Status Meaning Description Schema
200 OK The sent newsletter. Newsletter
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 /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 false

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

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 /templates/

Retrieve all templates.

Example responses

200 Response

[
  {
    "campaign_expires_at": "2019-11-13T08:58:50Z",
    "campaign_price": 0,
    "categories": [
      {
        "name": "string"
      }
    ],
    "current_price": 0,
    "data": {},
    "description": "string",
    "id": 0,
    "is_buyable": true,
    "is_editable": true,
    "is_on_sale": true,
    "name": "string",
    "preview_url": "string",
    "price": 0,
    "product_category": "string",
    "product_description": "string",
    "product_id": [
      "string"
    ],
    "product_type": "string",
    "screenshot_url": "string",
    "settings": {},
    "total_price": 0,
    "vat_amount": 0
  }
]

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
» campaign_expires_at string(date-time) false none
» campaign_price number false none
» categories [object] false none
»» name string false none
» current_price number false none
» data object false none
» description string false none
» id integer(int32) false none
» is_buyable boolean false none
» is_editable boolean false none
» is_on_sale boolean false none
» name string false none
» preview_url string false none
» price number false none
» product_category string false none
» product_description string false none
» product_id [string] false none
» product_type string false none
» screenshot_url string false none
» settings object false none
» total_price number false none
» vat_amount number false none

Schemas

CampaignDetail

{
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "name": "string",
  "statistics": {
    "bounce_rate": 0,
    "click_rate": 0,
    "num_recipients": 0,
    "open_rate": 0
  },
  "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 object false none
» bounce_rate number(float) false none
» click_rate number(float) false none
» num_recipients integer(int32) false none
» open_rate number(float) false none
utm_campaign string false none

Contact

{
  "added": "2019-11-13T08:58:50Z",
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "list_associations": [
    {
      "added": "2019-11-13T08:58:50Z",
      "email": "string",
      "list_id": 0,
      "status": "a",
      "status_changed": "2019-11-13T08:58:50Z"
    }
  ],
  "name": "string",
  "status": "a",
  "status_changed": "2019-11-13T08:58:50Z",
  "tags": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
added string(date-time) false none
email string(email) true none
first_name string false none
last_name string false none
list_associations [object] 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.
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

Domain

{
  "created_at": "string",
  "domain": "string",
  "has_authentication": true,
  "is_authentication_valid": true,
  "is_dmarc_passed": true,
  "is_free_domain": true,
  "is_verified": true,
  "spf_status": "string"
}

Properties

Name Type Required Restrictions Description
created_at string false read-only
domain string true none
has_authentication boolean false read-only
is_authentication_valid boolean false read-only
is_dmarc_passed boolean false read-only
is_free_domain boolean false read-only
is_verified boolean false read-only
spf_status string false read-only

Embed

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

Properties

Name Type Required Restrictions Description
options object false none
» content_manifest_url string(url) false none
» enable_dev_features boolean false none
» enable_newsletters_index boolean false none
» enable_subscription_management boolean false none
» locale string false none
session_type string true none
user_ip string true none

Enumerated Values

Property Value
locale en_US
locale nb_NO
locale sv_SE
session_type newsletters

Form

{
  "config": "string",
  "confirmation_html": "string",
  "created_at": "string",
  "editor_confirmation_html": "string",
  "editor_html": "string",
  "expired_at": "string",
  "fields": "string",
  "final_confirmation_html": "string",
  "final_html": "string",
  "html": "string",
  "id": 0,
  "lid": 0,
  "published_at": "string",
  "template_id": 0,
  "type": "subscribe",
  "updated_at": "string"
}

Properties

Name Type Required Restrictions Description
config string true none
confirmation_html string true none
created_at string false read-only
editor_confirmation_html string false read-only
editor_html string false read-only
expired_at string false read-only
fields string true none
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
published_at string false read-only
template_id integer(int32) false none
type string true none
updated_at string false read-only

Enumerated Values

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

HistoricalContactsStats

{
  "added": 0,
  "bounced": 0,
  "date": "2019-11-13",
  "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,
  "num_ignored": 0
}

Properties

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

List

{
  "created": "2019-11-13T08:58:50Z",
  "description": "string",
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "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
description string false none
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
linkedin string(url)¦null false none
name string true none
pinterest string¦null false none
subscribe_redirect_url string(url)¦null true none
subscribe_url string false read-only
twitter string¦null false none
unsubscribe_cascades boolean false none
unsubscribe_redirect_url string(url)¦null true none
unsubscribe_url string false read-only
website string(url)¦null false none
youtube string¦null false none

ListDetail

{
  "created": "2019-11-13T08:58:50Z",
  "description": "string",
  "facebook": "string",
  "from_email": "user@example.com",
  "from_name": "string",
  "id": 0,
  "instagram": "string",
  "linkedin": "string",
  "name": "string",
  "pinterest": "string",
  "segments": [
    {
      "created": "2019-11-13T08:58:50Z",
      "id": 0,
      "label": "string",
      "name": "string",
      "num_contacts": 0,
      "type": "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
description string false none
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
linkedin string(url)¦null false none
name string true none
pinterest string¦null false none
segments [object] false none
» created string(date-time) false read-only
» id integer(int32) false read-only
» label string false none
» name string true none
» num_contacts integer(int32) false read-only
» type string false read-only
subscribe_redirect_url string(url)¦null true none
subscribe_url string false read-only
twitter string¦null false none
unsubscribe_cascades boolean false none
unsubscribe_redirect_url string(url)¦null true none
unsubscribe_url string false read-only
website string(url)¦null false none
youtube string¦null false none

MinimalContact

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

Properties

Name Type Required Restrictions Description
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.
tags [string] false none

MinimalUser

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

Properties

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

Newsletter

{
  "completed": "2019-11-13T08:58:50Z",
  "data": [
    {}
  ],
  "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-11-13T08:58:50Z",
    "description": "string",
    "facebook": "string",
    "from_email": "user@example.com",
    "from_name": "string",
    "id": 0,
    "instagram": "string",
    "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",
  "saved": "2019-11-13T08:58:50Z",
  "screenshot_url": "string",
  "segments": [
    {
      "id": 0,
      "label": "string",
      "name": "string"
    }
  ],
  "started": "2019-11-13T08:58:50Z",
  "statistics": {
    "bounce_rate": 0,
    "click_rate": 0,
    "num_shares": 0,
    "open_rate": 0
  },
  "subject": "string",
  "template_id": 0,
  "utm_campaign": "string",
  "view_url": "string"
}

Properties

Name Type Required Restrictions Description
completed string(date-time) false read-only
data [object] false none
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
saved string(date-time) false read-only
screenshot_url string false none
segments [object] false none
» id integer(int32) false read-only
» label string false read-only
» name string false read-only
started string(date-time) false read-only
statistics object 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 string false none

NewsletterCreation

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

Properties

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

NewsletterSend

{
  "send_date": "2019-11-13T09:58:50.223175+01:00"
}

Properties

Name Type Required Restrictions Description
send_date string false none

NewsletterSendTest

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

Properties

Name Type Required Restrictions Description
emails [string] true none

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

PaginatedResult

{
  "data": [
    {}
  ],
  "meta": {
    "next_page": 0,
    "page": 0,
    "per_page": 0,
    "prev_page": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [object] false none
meta PageMeta false none

Subscriber

{
  "email": "user@example.com",
  "first_name": "string",
  "force_subscribe": true,
  "last_name": "string",
  "name": "string",
  "subscribed": "2019-11-13T08:58:51Z",
  "tags": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
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.
subscribed string(date-time) false read-only
tags [string] false none

Template

{
  "campaign_expires_at": "2019-11-13T08:58:51Z",
  "campaign_price": 0,
  "categories": [
    {
      "name": "string"
    }
  ],
  "current_price": 0,
  "data": {},
  "description": "string",
  "id": 0,
  "is_buyable": true,
  "is_editable": true,
  "is_on_sale": true,
  "name": "string",
  "preview_url": "string",
  "price": 0,
  "product_category": "string",
  "product_description": "string",
  "product_id": [
    "string"
  ],
  "product_type": "string",
  "screenshot_url": "string",
  "settings": {},
  "total_price": 0,
  "vat_amount": 0
}

Properties

Name Type Required Restrictions Description
campaign_expires_at string(date-time) false none
campaign_price number false none
categories [object] false none
» name string false none
current_price number false none
data object false none
description string false none
id integer(int32) false none
is_buyable boolean false none
is_editable boolean false none
is_on_sale boolean false none
name string false none
preview_url string false none
price number false none
product_category string false none
product_description string false none
product_id [string] false none
product_type string false none
screenshot_url string false none
settings object false none
total_price number false none
vat_amount number false none

User

{
  "address": "string",
  "city": "string",
  "contact_email": "user@example.com",
  "contact_name": "string",
  "created": "2019-11-13T08:58:51Z",
  "logo_url": "string",
  "name": "string",
  "num_contacts": 0,
  "partner": "string",
  "plan": "string",
  "trial_expires": "2019-11-13",
  "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_url string(url) false none
name string true none
num_contacts integer(int32) false read-only
partner string false read-only
plan string false read-only
trial_expires string(date) false read-only
username string false read-only
zip_code string false none