Developers

API v2 Documentation

Send email, validate addresses and manage contacts from your own applications.

API v2 documentation

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.

Authentication

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 email

Send a single email using an email account that belongs to your organization. Attachments are not supported in v2.

POST https://app2.mailrush.io/api/v2/email
FieldTypeRequiredNotes
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

  • subject is required.
  • Provide at least one of html or text. Send only text for a plain-text email with no HTML version.
  • Only the fields listed above are allowed. Other keys (for example cc, bcc or attachments) are rejected with 422.
  • If replyTo is not provided, fromEmail is used.
  • replyTo must be a single plain address (no display name). An address other than fromEmail must be verified for your organization by an owner or admin in Settings → API Key → Reply-To addresses; otherwise the request returns 422 and nothing is sent.
  • Replies sent to a replyTo address go directly to that mailbox and do not appear in the MailRush inbox, reply statistics or reply webhooks. Bounces are not affected.
  • Attachments are not accepted by this endpoint.
  • API emails are sent as provided: no open tracking, link tracking, footer or unsubscribe header is added. The From name is the name saved on the email account.
  • API rate limits: up to 10 API emails per minute and 100 per hour per organization (free trial: 2 per minute, 10 per hour, 10 per day and 30 per month). API emails also count toward your plan's daily and 30-day totals.
  • Per-sender limits: each fromEmail can send up to 100 emails per hour (MailRush mailboxes) or 200 per hour (connected external mailboxes), and up to your plan's daily limit per day. Campaigns, API, warmup and inbox replies from the same sender share these limits. When one is reached the request returns 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>" }

Avoiding duplicate sends

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

  • If that email was already accepted, the retry returns success: true with the original messageId and replayed: true, and nothing is sent again.
  • The same key with a different body returns 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.

Validate email

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.

POST https://app2.mailrush.io/api/v2/email/validate
FieldTypeRequiredNotes
email string (email) Yes The address to validate.

Rules

  • The body contains only email. Extra keys are rejected with 422.
  • An optional Idempotency-Key header makes retries safe.
  • Each request uses one validation from your plan's monthly allowance, then from purchased credits. When none are left the response is 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 contact

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.

POST https://app2.mailrush.io/api/v2/contacts
FieldTypeRequiredNotes
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

  • Duplicate emails are rejected with 400.
  • Only the fields listed above are allowed. Extra keys cause 422 Unexpected fields.
  • When your plan's contact limit is reached, the contact is not created and the response is 403 with code: "CONTACT_LIMIT_REACHED" and the limit. Deleted contacts do not count.
  • A contact created with the tag of a running campaign enters that campaign's sequence automatically.

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 tag to contact

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.

POST https://app2.mailrush.io/api/v2/contacts/tags
FieldTypeRequiredNotes
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

  • The endpoint only adds a tag. It never removes or replaces tags and never changes the contact's fields, subscription or verification status. Remove tags in Contacts.
  • The contact must exist and not be deleted; otherwise the response is 404 with code: "CONTACT_NOT_FOUND". Create new contacts with POST /contacts.
  • The tag must already exist in your organization (create it in Contacts first); otherwise the response is 404 with code: "TAG_NOT_FOUND". Check the spelling: a misspelled tag is never created automatically.
  • Repeating the request is safe. If the contact already has the tag, the response is 200 with added: false, and the contact is never put in a campaign twice.
  • Only 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

  • A contact receives each campaign once. If the contact was already sent the campaign's first email (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.
  • Sending is not immediate. The campaign sends the first email on its own schedule: only while it is 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.
  • Unsubscribed and invalid contacts are tagged but not emailed. Check subscribed and verification_status in the response. Your suppression list, bounce pauses and provider blocks still apply.
  • Check the campaigns list. An empty 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.
  • Removing a tag later (in Contacts) cancels a first email that was not sent yet, but only if the contact has no other tag of that campaign. Follow-ups already started keep running; to stop them, unsubscribe the contact or add the address to the Suppression List (both apply to all your campaigns).
  • Adding a tag does not send a webhook or a Zapier event. Use the Sending status tab of the campaign report to see queued emails.

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 }
  ]
}
FieldTypeRequiredNotes
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 contact

Unsubscribe a contact (opt-out) by email within your organization. The operation is idempotent: repeating it is safe.

POST https://app2.mailrush.io/api/v2/contacts/unsubscribe
FieldTypeRequiredNotes
email string (email) Yes Must exist in your organization.

Rules

  • Extra keys are rejected with 422.
  • An email that does not exist in your organization returns 404.
  • Unsubscribed contacts are skipped by campaigns. API emails are sent to the address you request, so check your own suppression data before calling the send endpoint.

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 codes

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.

Send your first API email in minutes

Start your free trial, copy your API key from Settings and make your first request. No credit card required.