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" }],
      "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)
requests[].fromobjectemail (required), name (optional)
requests[].toarrayRecipients with email and optional name
requests[].subjectstringSubject line
requests[].body.htmlstringHTML content
requests[].body.textstring?Plain text fallback
requests[].custom_idstring?Your identifier, 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.

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.

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" }],
  subject: "Order confirmation #1234",
  body: {
    html: "<h1>Thank you!</h1>",
    text: "Thank you! Your order has been confirmed.",
  },
  custom_id: "order-1234",
  tracking: { opens: "last_only", disabled: false },
});

Parameters

ParameterTypeDescription
fromobjectemail (required), name (optional)
toarrayRecipients with email and optional name
subjectstringSubject line
body.htmlstringHTML content
body.textstring?Plain text fallback
custom_idstring?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.