Documentation

Send Email

Multiple ways to send. Pick the one that fits your stack.

Authentication

Every request needs a bearer token and the email:send permission. See Authentication for how to get one.

Send an email

curl -X POST https://api.mailverick.com/v1/send-email \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "requests": [{
      "from": { "email": "you@yourdomain.com" },
      "to": [{ "email": "recipient@example.com" }],
      "reply_to": { "email": "support@yourdomain.com" },
      "subject": "Order confirmation #1234",
      "body": {
        "html": "<h1>Thank you!</h1><p>Your order has been confirmed.</p>",
        "text": "Thank you! Your order has been confirmed."
      },
      "custom_id": "order-1234",
      "tracking": { "opens": "last_only", "disabled": false }
    }]
  }'

Request body

FieldTypeDescription
requestsarrayArray of email requests (batch), at least one
requests[].fromobjectemail (required), name (optional, up to 64 characters)
requests[].toarray1 to 50 recipients, each with email and optional name
requests[].reply_toobject?Address replies go to: email (required), name (optional). Sets the Reply-To header
requests[].subjectstringSubject line, up to 998 characters
requests[].body.htmlstring?HTML content. Provide html, text, or both
requests[].body.textstring?Plain text content, also used as the fallback for HTML
requests[].attachmentsarray?Files attached to the email, each with file_name (up to 255 characters), content_type (for example application/pdf) and base64_content (the file, base64-encoded)
requests[].inline_attachmentsarray?Images embedded in the HTML: same fields as attachments, plus content_id (up to 255 printable ASCII characters, no spaces or angle brackets). Reference them in the HTML as <img src="cid:your-content-id">
requests[].custom_idstring?Your identifier, up to 256 characters, returned in all events
requests[].trackingobject?opens: none, last_only, or full (open-tracking mode; defaults to your tenant setting). disabled: boolean, turns off open and click tracking for this email.

The whole request body is limited to 20 MB, attachments included. Base64 encoding makes a file about a third larger than its original size.

Responses

A successful call returns 201 with an empty body: the batch is accepted and delivered asynchronously. Track what happens next with Email Events.

StatusCodeWhen
201Accepted for delivery. Empty body
400VALIDATION_ERRORMalformed body, or a field failed validation
401UNAUTHORIZEDMissing, malformed, or expired bearer token
402ACCOUNT_PAYMENT_OVERDUEThe account has an unpaid invoice
403FORBIDDENThe service account lacks the email:send permission
403ACCOUNT_SUSPENDED, TENANT_SUSPENDEDThe account or tenant is suspended
429MONTHLY_QUOTA_EXCEEDED, DAILY_QUOTA_EXCEEDEDThe sending quota for the period is spent. Nothing in the batch was sent
429RATE_LIMITEDToo many requests, or too many recent sends to one of the recipients
500INTERNAL_ERRORSomething went wrong on our side

Install

npm install @bytewise-solutions/mailverick

Send an email

The SDK handles token exchange and refresh automatically. Pass your API key credentials and send. Use sendEmails to send several emails in one batch.

import { Mailverick } from "@bytewise-solutions/mailverick";

const client = new Mailverick("mvk_id_xxx", "mvk_sec_xxx");

await client.sendEmail({
  from: { email: "you@yourdomain.com" },
  to: [{ email: "recipient@example.com" }],
  replyTo: { email: "support@yourdomain.com" },
  subject: "Order confirmation #1234",
  body: {
    html: "<h1>Thank you!</h1>",
    text: "Thank you! Your order has been confirmed.",
  },
  customId: "order-1234",
  tracking: { opens: "last_only", disabled: false },
});

Parameters

ParameterTypeDescription
fromobjectemail (required), name (optional)
toarray1 to 50 recipients, each with email and optional name
replyToobject?Address replies go to: email (required), name (optional)
subjectstringSubject line
body.htmlstring?HTML content. Provide html, text, or both
body.textstring?Plain text content
attachmentsarray?Files with fileName, contentType and base64Content
inlineAttachmentsarray?Same fields plus contentId, referenced in the HTML as cid:your-content-id
customIdstring?Your identifier, returned in all events
trackingobject?opens: none, last_only, or full. disabled: boolean, turns off open and click tracking for this email.

Configuration

No token needed. Authenticate directly with your API key credentials. Drop-in replacement for any SMTP configuration.

Use port 465, which encrypts the connection before any data is sent. Port 587 is also supported and upgrades to TLS with STARTTLS. Cleartext authentication is refused on both, so your client has to complete TLS before it authenticates.

SettingValue
Hostsmtp.mailverick.com
Port465 preferred, or 587
SecurityImplicit TLS on 465, STARTTLS on 587
UsernameYour mvk_id_ API key ID
PasswordYour mvk_sec_ API key secret

Framework examples

SMTP_HOST=smtp.mailverick.com
# Use 587 with STARTTLS, or 465 with implicit TLS. Cleartext auth is refused.
# Django and Spring need their TLS setting enabled explicitly.
SMTP_PORT=587
SMTP_USER=mvk_id_xxxxxxxxxx
SMTP_PASS=mvk_sec_xxxxxxxxxx
const nodemailer = require("nodemailer");

const transporter = nodemailer.createTransport({
  host: "smtp.mailverick.com",
  port: 465,
  secure: true,
  auth: {
    user: "mvk_id_xxxxxxxxxx",
    pass: "mvk_sec_xxxxxxxxxx",
  },
});

await transporter.sendMail({
  from: "you@yourdomain.com",
  to: "recipient@example.com",
  subject: "Order confirmation #1234",
  html: "<h1>Thank you!</h1>",
});
# settings.py
EMAIL_HOST = "smtp.mailverick.com"
EMAIL_PORT = 465
EMAIL_HOST_USER = "mvk_id_xxxxxxxxxx"
EMAIL_HOST_PASSWORD = "mvk_sec_xxxxxxxxxx"
EMAIL_USE_SSL = True
# .env
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailverick.com
MAIL_PORT=465
MAIL_USERNAME=mvk_id_xxxxxxxxxx
MAIL_PASSWORD=mvk_sec_xxxxxxxxxx
MAIL_ENCRYPTION=ssl
# application.properties
spring.mail.host=smtp.mailverick.com
spring.mail.port=465
spring.mail.username=mvk_id_xxxxxxxxxx
spring.mail.password=mvk_sec_xxxxxxxxxx
spring.mail.properties.mail.smtp.ssl.enable=true

What's next

Now that you can send emails, learn how to track what happens after delivery with Email Events: delivery status, bounces, opens, clicks, and spam reports in real time.