API v2 Documentation

Official API documentation for the MailRush.io cold email automation platform. Integrate email sending and contact management into your applications in minutes.

Introduction

This is the official documentation for MailRush.io API v2. The API is RESTful and uses JSON over HTTPS.

Base URL

https://app2.mailrush.io/api/v2

All requests must include your API key in the x-api-key header.

POST /email — Send Email

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

Endpoint

POST https://app2.mailrush.io/api/v2/email

Headers: Content-Type: application/json, x-api-key: YOUR_API_KEY

Field Type Required Notes
fromEmailstring (email)YesMust be an active SMTP account in your organization.
recipientEmailstring (email)YesPrimary recipient.
subjectstringYesCannot be empty.
htmlstring (HTML)Yes*Required if text is not provided.
textstringYes*Required if html is not provided. If omitted and html is present, a text version is auto-generated.
replyTostring (email)NoDefaults to fromEmail when omitted.

Constraints

  • subject is required.
  • Provide at least one of html or text.
  • If replyTo is not provided, fromEmail is used.
  • Attachments are not accepted in this endpoint.

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": "notificaciones@yourdomain.com",
    "recipientEmail": "alice@example.com",
    "subject": "Welcome!",
    "html": "

Hello

Your account is ready.

" }'

Successful response

{ "success": true, "messageId": "" }

POST /contacts — Create Contact

Create a contact inside your organization and assign it to a tag. If the tag does not exist, it is created. Duplicate emails are rejected.

Endpoint

POST https://app2.mailrush.io/api/v2/contacts

Headers: Content-Type: application/json, x-api-key: YOUR_API_KEY

Field Type Required Notes
emailstring (email)YesUnique per organization (non-deleted contacts).
first_namestringNo
last_namestringNo
titlestringNoHonorific or role label.
companystringNo
phonestringNo
custom1..custom6stringNoFree-form fields.
tagstringNoDefaults to untagged when omitted.

Rules

  • Duplicate emails are rejected with 400.
  • Only the fields listed above are allowed. Extra keys cause 422 Unexpected fields.

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"
}

POST /contacts/unsubscribe — Unsubscribe Contact

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

Endpoint

POST https://app2.mailrush.io/api/v2/contacts/unsubscribe

Headers: Content-Type: application/json, x-api-key: YOUR_API_KEY

Field Type Required Notes
emailstring (email)YesMust exist in your organization. Extra keys are rejected (422).

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" }

Authentication

MailRush.io uses API Key authentication. Include your private key in the x-api-key header on every request. All endpoints require HTTPS/TLS.

x-api-key: YOUR_API_KEY
Content-Type: application/json

Status Codes

Status Label Description
200OKSuccessful operation.
201CreatedResource created (e.g., contact).
400Bad RequestBusiness rule violation (e.g., duplicate contact email).
401UnauthorizedInvalid API key or inactive organization.
403ForbiddenNot allowed by business rules (e.g., fromEmail not permitted).
404Not FoundResource not found (e.g., contact to unsubscribe does not exist).
422Unprocessable EntityValidation failed (missing/invalid fields, unexpected keys).
429Too Many RequestsSending limits exceeded (email endpoint).
500Server ErrorInternal or SMTP provider error.