Integrate your application with our API v2 and webhooks: send emails, manage contacts and pick up replies and other events as they happen.
Illustration with example data. Reply and bounce events are abridged; see the API documentation for every field.
Use our REST API with JSON over HTTPS. Authenticate every request with your API key in the x-api-key header.
POST /api/v2/email — Send email (no attachments)POST /api/v2/email/validate — Queue validation of an email addressPOST /api/v2/contacts — Create contact & tagPOST /api/v2/contacts/unsubscribe — Unsubscribe contact<?php
$baseUrl = 'https://app2.mailrush.io';
$apiKey = 'YOUR_API_KEY';
// Send Email - POST /api/v2/email
$payload = [
'fromEmail' => 'notifications@yourcompany.com',
'recipientEmail' => 'customer@domain.com',
'subject' => 'Your receipt',
'html' => '<h1>Thank you for your purchase</h1><p>Your receipt is available.</p>'
];
$ch = curl_init($baseUrl . '/api/v2/email');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'x-api-key: ' . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Requires Node 18+ (native fetch)
const BASE = "https://app2.mailrush.io";
const API_KEY = process.env.MAILRUSH_API_KEY;
const res = await fetch(`${BASE}/api/v2/email`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": API_KEY
},
body: JSON.stringify({
fromEmail: "notifications@yourcompany.com",
recipientEmail: "customer@domain.com",
subject: "Your receipt",
html: "<h1>Thank you for your purchase</h1><p>Your receipt is available.</p>"
})
});
console.log(res.status, await res.json());
import os, requests
BASE = "https://app2.mailrush.io"
headers = {"Content-Type": "application/json", "x-api-key": os.environ.get("MAILRUSH_API_KEY")}
email_body = {
"fromEmail": "notifications@yourcompany.com",
"recipientEmail": "customer@domain.com",
"subject": "Your receipt",
"html": "<h1>Thank you for your purchase</h1><p>Your receipt is available.</p>"
}
r = requests.post(f"{BASE}/api/v2/email", json=email_body, headers=headers)
print(r.status_code, r.text)
curl -X POST https://app2.mailrush.io/api/v2/email \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"fromEmail": "notifications@yourcompany.com",
"recipientEmail": "customer@domain.com",
"subject": "Your receipt",
"html": "<h1>Thank you for your purchase</h1>"
}'
Send one email per request from any active email account in your organization: one of your own connected mailboxes or a MailRush email account. API emails are sent exactly as you provide them, without tracking, footer or unsubscribe header, and count toward your plan's sending limits. Use an Idempotency-Key header to retry safely without sending the same email twice.
MailRush email accounts can run on a dedicated-IP server used only by your organization, so other customers' sending does not affect the IP and you build your own sending reputation. Poor sending can still get it blocked.
Send emails, validate addresses and manage contacts from your own app. Start free for 14 days and get your API key from Settings. No credit card required.