v1

latestSwagger 2.0MIT2026-07-17233380637.0 KB
Transactional emails

Send a transactional email

post/smtp/email

Request body

htmlContentstring

HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed )

textContentstring

Plain Text body of the message ( Ignored if 'templateId' is passed )

subjectstring

Subject of the message. Mandatory if 'templateId' is not passed

headersobject

Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in This-Case-Only (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, {"sender.ip":"1.2.3.4", "X-Mailin-custom":"some_custom_header", "idempotencyKey":"abc-123"}.

templateIdinteger

Id of the template.

paramsobject

Pass the set of attributes to customize the template. For example, {"FNAME":"Joe", "LNAME":"Doe"}. It's considered only if template is in New Template Language format.

tagsstring[]

Tag your emails to find them more easily

scheduledAtstring date-time

UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. Please note this feature is currently a public beta.

batchIdstring

Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end.

Example request

{
  "sender": {
    "name": "Mary from MyShop",
    "email": "no-reply@myshop.com",
    "id": 2
  },
  "to": [
    {
      "email": "jimmy98@example.com",
      "name": "Jimmy"
    }
  ],
  "bcc": [
    {
      "email": "helen9766@example.com",
      "name": "Helen"
    }
  ],
  "cc": [
    {
      "email": "ann6533@example.com",
      "name": "Ann"
    }
  ],
  "htmlContent": "<!DOCTYPE html> <html> <body> <h1>Confirm you email</h1> <p>Please confirm your email address by clicking on the link below</p> </body> </html>",
  "textContent": "Please confirm your email address by clicking on the link https://text.domain.com",
  "subject": "Login Email confirmation",
  "replyTo": {
    "email": "ann6533@example.com",
    "name": "Ann"
  },
  "attachment": [
    {
      "url": "https://attachment.domain.com/myAttachmentFromUrl.jpg",
      "content": "b3JkZXIucGRm",
      "name": "myAttachment.png"
    }
  ],
  "headers": {
    "sender.ip": "1.2.3.4",
    "X-Mailin-custom": "some_custom_header",
    "idempotencyKey": "abc-123"
  },
  "templateId": 2,
  "params": {
    "FNAME": "Joe",
    "LNAME": "Doe"
  },
  "messageVersions": [
    {
      "to": [
        {
          "email": "jimmy98@example.com",
          "name": "Jimmy"
        }
      ],
      "params": {
        "FNAME": "Joe",
        "LNAME": "Doe"
      },
      "bcc": [
        {
          "email": "helen9766@example.com",
          "name": "Helen"
        }
      ],
      "cc": [
        {
          "email": "ann6533@example.com",
          "name": "Ann"
        }
      ],
      "replyTo": {
        "email": "ann6533@example.com",
        "name": "Ann"
      },
      "subject": "Login Email confirmation",
      "htmlContent": "<!DOCTYPE html> <html> <body> <h1>Confirm you email</h1> <p>Please confirm your email address by clicking on the link below</p> </body> </html>",
      "textContent": "Please confirm your email address by clicking on the link https://text.domain.com"
    }
  ],
  "tags": [
    "tag1"
  ],
  "scheduledAt": "2022-04-05T12:30:00+02:00",
  "batchId": "5c6cfa04-eed9-42c2-8b5c-6d470d978e9d"
}

Response

transactional email sent

messageIdstring

Message ID of the transactional email sent

messageIdsstring[]

Example response

{
  "messageIds": [
    "",
    ""
  ],
  "messageId": "<201798300811.5787683@relay.domain.com>"
}