Developers
Send email, validate addresses and manage contacts from your own applications.
The MailRush API is RESTful and uses JSON over HTTPS. Use it to send email, validate addresses and manage contacts from your own applications.
Base URL
https://app2.mailrush.io/api/v2
All requests must include your API key in the x-api-key header. Find your key in Settings → API Key.
Prefer to explore interactively? Run the collection in Postman.
MailRush uses API key authentication. Include your private key in the x-api-key header on every request. All endpoints require HTTPS. Keep your key secret: anyone with it can send email from your organization.
Request headers
x-api-key: YOUR_API_KEY
Content-Type: application/json
Send a single email using an email account that belongs to your organization. Attachments are not supported in v2.
https://app2.mailrush.io/api/v2/email
| Field | Type | Required | Notes |
|---|---|---|---|
fromEmail |
string (email) | Yes | Must be an active email account in your organization. |
recipientEmail |
string (email) | Yes | Primary recipient. |
subject |
string | Yes | Cannot be empty. |
html |
string (HTML) | Yes* | Required if text is not provided. |
text |
string | Yes* | Required if html is not provided. If omitted and html is present, a text version is generated automatically. |
replyTo |
string (email) | No | Defaults to fromEmail. Any other address must first be verified in Settings → API Key → Reply-To addresses. |
Constraints
cc, bcc or attachments) are rejected with 422.422 and nothing is sent.429 with code SENDER_HOURLY_LIMIT or SENDER_DAILY_LIMIT, a Retry-After header (seconds) and a senderLimit object (window, limit, retryAt, retryAfterSeconds). Nothing is sent; retry after that time or use another sender.Request example (cURL)
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@yourdomain.com",
"recipientEmail": "alice@example.com",
"subject": "Welcome!",
"html": "<h1>Hello</h1><p>Your account is ready.</p>"
}'
Successful response
{ "success": true, "messageId": "<message-id@your-smtp>" }
Send an optional Idempotency-Key header (1 to 200 visible ASCII characters, for example your own send ID) with each email, and repeat the same key and body when you retry.
How retries behave
success: true with the original messageId and replayed: true, and nothing is sent again.409 IDEMPOTENCY_KEY_CONFLICT. Without a key, every request is a new email.409 EMAIL_SEND_OUTCOME_UNKNOWN means the email may or may not have been sent. Do not resend it automatically; check the Inbox Sent tab in MailRush with the type set to API emails.202 with recordingPending: true means the email was accepted but recording is not finished. Do not resend.Queue validation of one email address. The address is saved as a contact in your organization (or the existing contact is used), and the result is stored on that contact when validation finishes. The response confirms the request was queued; it does not contain the result.
https://app2.mailrush.io/api/v2/email/validate
| Field | Type | Required | Notes |
|---|---|---|---|
email |
string (email) | Yes | The address to validate. |
Rules
email. Extra keys are rejected with 422.Idempotency-Key header makes retries safe.429.Request example (cURL)
curl -X POST https://app2.mailrush.io/api/v2/email/validate \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{ "email": "maria.perez@example.com" }'
Successful response (202)
{
"success": true,
"status": "queued",
"email": "maria.perez@example.com",
"contact_id": 12345,
"public_id": "4f9d2f0e3b1c4e21b6c2f8d1",
"created_contact": false,
"jobId": "..."
}
Create a contact in your organization and assign it to a tag. If the tag does not exist, it is created. Duplicate emails are rejected.
https://app2.mailrush.io/api/v2/contacts
| Field | Type | Required | Notes |
|---|---|---|---|
email |
string (email) | Yes | Unique per organization (non-deleted contacts). |
first_name |
string | No | — |
last_name |
string | No | — |
title |
string | No | Honorific or role label. |
company |
string | No | — |
phone |
string | No | — |
custom1..custom6 |
string | No | Free-form fields. |
tag |
string | No | Defaults to untagged. A tag that does not exist is created. |
Rules
400.422 Unexpected fields.403 with code: "CONTACT_LIMIT_REACHED" and the limit. Deleted contacts do not count.Request example (cURL)
curl -X POST https://app2.mailrush.io/api/v2/contacts \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"email": "maria.perez@example.com",
"first_name": "Maria",
"last_name": "Perez",
"company": "Example Inc.",
"tag": "customers"
}'
Successful response (201)
{
"success": true,
"contact_id": 12345,
"public_id": "4f9d2f0e3b1c4e21b6c2f8d1",
"tag": "customers"
}
Add one existing tag to a contact that already exists, for example when your system sees a click or a form submission. The contact keeps all its other tags. Campaign audiences are built from tags, so the contact joins the audience of every campaign that uses this tag.
https://app2.mailrush.io/api/v2/contacts/tags
| Field | Type | Required | Notes |
|---|---|---|---|
email |
string (email) | Yes | An existing, non-deleted contact in your organization. |
tag |
string | Yes | An existing tag name (up to 100 characters). Tags are not created by this endpoint. |
Rules
404 with code: "CONTACT_NOT_FOUND". Create new contacts with POST /contacts.404 with code: "TAG_NOT_FOUND". Check the spelling: a misspelled tag is never created automatically.200 with added: false, and the contact is never put in a campaign twice.email and tag are allowed. Extra keys cause 422 Unexpected fields. The request does not count toward your contact limit.Before you automate campaign enrollment with tags
already_received: true), adding the tag again, or another tag of the same campaign, does not restart the campaign or resend any step. To email the contact again, use a different campaign.running, on its sending days and hours, at its sending frequency, and within your sender's hourly and daily limits. Paused or draft campaigns send nothing until they run. Follow-ups use the campaign's own wait days.subscribed and verification_status in the response. Your suppression list, bounce pauses and provider blocks still apply.campaigns array means no campaign uses this tag, so nothing will be sent. If several campaigns use it, the contact joins all of them, and each sends separately.Request example (cURL)
curl -X POST https://app2.mailrush.io/api/v2/contacts/tags \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"email": "maria.perez@example.com",
"tag": "clicked-offer"
}'
Successful response (200)
{
"success": true,
"contact_id": 12345,
"tag": "clicked-offer",
"added": true,
"subscribed": true,
"verification_status": "valid",
"campaigns": [
{ "campaign_id": 678, "name": "Offer follow-up", "status": "running", "already_received": false }
]
}
| Field | Type | Required | Notes |
|---|---|---|---|
added |
boolean | — | false when the contact already had the tag. Nothing changed. |
subscribed |
boolean | — | false means the contact is unsubscribed: it is tagged, but campaigns do not email it. |
verification_status |
string | — | The contact's verification status. Contacts marked invalid are not emailed by campaigns. |
campaigns |
array | — | Campaigns whose audience uses this tag: campaign_id, name, status and already_received. already_received: true means the campaign does not start again for this contact. |
Unsubscribe a contact (opt-out) by email within your organization. The operation is idempotent: repeating it is safe.
https://app2.mailrush.io/api/v2/contacts/unsubscribe
| Field | Type | Required | Notes |
|---|---|---|---|
email |
string (email) | Yes | Must exist in your organization. |
Rules
422.404.Request example (cURL)
curl -X POST https://app2.mailrush.io/api/v2/contacts/unsubscribe \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{ "email": "jon@example.com" }'
Successful responses
{ "success": true, "message": "Unsubscribed successfully" }
{ "success": true, "message": "Already unsubscribed" }
| Status | Label | Description |
|---|---|---|
| 200 | OK | Successful operation. |
| 201 | Created | Resource created (for example, a contact). |
| 202 | Accepted | Validation queued, or email accepted with recordingPending (do not resend). |
| 400 | Bad Request | Business rule violation (for example, a duplicate contact email). |
| 401 | Unauthorized | Invalid API key or inactive organization. |
| 403 | Forbidden | Not allowed by business rules (for example, fromEmail not permitted, or CONTACT_LIMIT_REACHED). |
| 404 | Not Found | Resource not found (for example, the contact to unsubscribe does not exist). The tag endpoint returns CONTACT_NOT_FOUND or TAG_NOT_FOUND. |
| 409 | Conflict | IDEMPOTENCY_KEY_CONFLICT (same key, different body) or EMAIL_SEND_OUTCOME_UNKNOWN (do not resend automatically). |
| 422 | Unprocessable Entity | Validation failed (missing or invalid fields, unexpected keys). |
| 429 | Too Many Requests | A limit was reached and nothing was sent. Sender limits return code SENDER_HOURLY_LIMIT or SENDER_DAILY_LIMIT with a Retry-After header; organization-wide limits return EMAIL_QUOTA_EXCEEDED. A sender blocked for the recipient's provider after a bounce reported spam, a blocklist or abuse returns SENDER_PROVIDER_BLOCKED with retryAt, a senderProviderBlock object and Retry-After. On the validate endpoint, no validations are left. |
| 500 | Server Error | Internal or email provider error. |
Start your free trial, copy your API key from Settings and make your first request. No credit card required.