This is the official API documentation for MailRush.io.

Below you will find a current list of the available methods for MailRush.io.

NOTE: You will need to have a valid account to use the API.

Base URL: https://app.mailrush.io/api/v1

Authentication

MailRush.io use the API Key authentication mechanism where you need to send your private API Key on every call you make to MailRush.io API. MailRush.io API use HTTPS/TLS for secure transportation the data sent to MailRush.io API.

Status Codes

MailRush.io API will respond with one of the following HTTP status codes as part of the JSON response to any API request.

Status Response Description
200 SUCCESS Request completed successfully.
202 ACCEPTED Request was accepted.
400 INVALID REQUEST The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 UNAUTHORIZED Authentication credentials were missing or incorrect.
403 FORBIDDEN The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why.
404 NOT FOUND The URI requested is invalid or the resource requested does not exists.
405 METHOD NOT ALLOWED Method doesn't exist or is not allowed.
429 TOO MANY REQUESTS Rate Limit Exceeded. Returned when a request cannot be served due to the application’s rate limit having been exhausted for the resource. See Rate Limiting.
500 INTERNAL SERVER ERROR Server side error

Supported Methods

Mail Send API Method

The Mail Send API Method allow you to send emails via an HTTPS POST request to the API Server. Its use is inteded for single Email sending capabilites.

Call

POST https://app.mailrush.io/api/v1/mail/send
Data { apikey: "your-api-key", from: 'Bob <youruser@yourmailrushdomain.tld>', to: 'alice@destination.tld', subject: 'Example Subject', text: "Plain text message", html: "<p>Html message</p>" }

JSON Response

Success:
{"code": "202","result": "OK"}
Error:
{ code: "401", result: "Invalid apikey" }

Code Examaples

PHP
<?php

//API Url
$url = 'https://app.mailrush.io/api/v1/mail/send';
    
//Initiate cURL.
$ch = curl_init($url);
    
//The JSON data.
$jsonData = array(
    'apikey' => 'your-api-key',
    'from' => 'bob@yourdomain.com',
    'to' => 'alice@otherdomain.com',
    'subject' => 'Example Subject',
    'text' => 'Hello World, this is a text.',
    'html' => '<p>Hello World, this is a text.</p>';
);
    
//Encode the array into JSON.
$jsonDataEncoded = json_encode($jsonData);
    
//Tell cURL that we want to send a POST request.
url_setopt($ch, CURLOPT_POST, 1);
    
//Attach our encoded JSON string to the POST fields.
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
    
//Set the content type to application/json
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); 
    
//Execute the request
$result = curl_exec($ch);                       

                                

                                

                                

                                

Mail List Incoming API Method

The Mail List Incoming API Method return a list of incoming emails received by your MailRush.io Email address.

Call

POST https://app.mailrush.io/api/v1/mail/list
Data { apikey: "your-api-key", message_id: '', page: '', results: '10', folder: '', date_from: '', date_to: '' }

Parameters

Parameter Name Value Required/Optional Description
apikey string required Your MailRush.io API Key.
message_id string optional Email message identifier
page int optional Result page for paging. Default 1.
results int optional Results to show per page. Default 10.
folder string optional Folder result to retreive. Default 'Inbox'.
date_from datetime optional Starting Date for search. Default current date. Format: 'YYYY-MM-DD HH:MM:SS'
date_to datetime optional Ending Date for search. Default current date. Format: 'YYYY-MM-DD HH:MM:SS'

JSON Response

Success:
{ "code": "202", results: 100, data: [] }
Error:
{ code: "401", result: "Invalid apikey" }

Get all campaigns

This method will retreive all campaigns details for your MailRush.io account via an HTTPS POST

Call

POST https://app.mailrush.io/api/v1/campaign/list
Data { apikey: "your-api-key" }

Parameters

Parameter Name Value Required/Optional Description
apikey string required Your MailRush.io API Key.

JSON Response

Success:
{ "code": "202", result: "OK", data: array, contact_count: int }
Error:
{ code: "401", result: "Invalid apikey" }

Add subscriber to a campaign/list

The Mail List Incoming API Method subscribe a contact a mailing list asigned to a campaign at MailRush.io via an HTTPS POST

Call

POST https://app.mailrush.io/assets/{YOUR CAMPAIGN NUMERIC ID}/subscribe
Data { apikey: "your-api-key", name: '', email: '', }

Parameters

Parameter Name Value Required/Optional Description
apikey string required Your MailRush.io API Key.
Name string optional Contact Name for the subscriber
Email string required Valid Email Address format

JSON Response

Success:
{ "code": "202", results: "Contact subscribed" }
Error:
{ code: "401", result: "Invalid apikey" }

Add Email Template to a campaign

The Add Template API Method assign an email template to a campaign at MailRush.io via an HTTPS POST

Call

POST https://app.mailrush.io/api/v1/template/add
Data { apikey: "your-api-key", templatename: "template senders name", templateemail: "template senders email", templatesubject: "subject line", templatesubjectb: "subject line for B test", templatebody: "body line", templatecampaign: numerid_id, btest: false, tunsub: true }

Parameters

Parameter Name Value Required/Optional Description
apikey string required Your MailRush.io API Key.
templatename string required Senders Name for your Email template.
templateemail string required Valid Email Address for sender
templatesubject string required Subject line for Email template
templatesubjectb string optional Subject line for B Testing.
templatebody string required HTML content for Email Template Body
templatecampaign intiger required Numeric ID of the campaign you want to assign the template
btest bool required True or False. True activates B test for subject
tunsub bool required True or False. True activates unsubscription link at email body

JSON Response

Success:
{ "code": "202", results: "OK" }
Error:
{ code: "401", result: "Invalid apikey" }