Sending Emails

Send transactional email with POST /api/public/v1/email/send.

Send email with a single API call. Put your content in the message field — plain text or HTML. Notify detects the format and builds the email body accordingly.

Endpoint

POST https://notify.cx/api/public/v1/email/send

Authenticate with the x-api-key header. The request body accepts:

| Field | Required | Description | | --- | --- | --- | | to | Yes | Recipient email address | | subject | Yes | Email subject line | | message | Yes | Plain text or HTML body | | from | No | Sender address on a verified domain |

Legacy paths /api/email/send and /api/send-email rewrite to the same handler.

Basic send

await fetch('https://notify.cx/api/public/v1/email/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.NOTIFY_API_KEY!
  },
  body: JSON.stringify({
    to: 'recipient@example.com',
    subject: 'Hello!',
    message: 'Your email content here'
  })
});

Plain text message

Pass a normal string in message. Newlines become separate paragraphs.

await fetch('https://notify.cx/api/public/v1/email/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.NOTIFY_API_KEY!
  },
  body: JSON.stringify({
    to: 'user@example.com',
    subject: 'Welcome aboard!',
    message: 'Thanks for joining us!'
  })
});

What gets delivered (email body):

<!DOCTYPE html>
<html lang="en">
  <body>
    <p style="font-size:16px;line-height:24px;margin:16px 0;color:#000000;">
      Thanks for joining us!
    </p>
  </body>
</html>

API response:

{
  "success": true,
  "data": {
    "messageId": "01000194b1dd1c04-b51e7343-6808-4a68-b2af-845feae57f8b-000000"
  }
}

HTML message

Pass HTML in message as a string. Notify sanitizes it and inlines CSS before sending.

await fetch('https://notify.cx/api/public/v1/email/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.NOTIFY_API_KEY!
  },
  body: JSON.stringify({
    to: 'user@example.com',
    subject: 'Welcome aboard!',
    message: `
      <div style="font-family: Arial, sans-serif; max-width: 560px; margin: 0 auto;">
        <h1 style="color: #111827; font-size: 28px; margin-bottom: 8px;">
          Welcome to Acme!
        </h1>
        <p style="color: #374151; font-size: 16px; line-height: 24px;">
          Thanks for joining us. Your account is ready — click below to get started.
        </p>
        <a
          href="https://example.com/get-started"
          style="display: inline-block; margin-top: 16px; padding: 12px 20px; background: #111827; color: #ffffff; text-decoration: none; border-radius: 6px;"
        >
          Get started
        </a>
      </div>
    `
  })
});

What gets delivered (email body):

<!DOCTYPE html>
<html lang="en">
  <body>
    <div style="font-family:Arial,sans-serif;max-width:560px;margin:0 auto;">
      <h1 style="color:#111827;font-size:28px;margin-bottom:8px;">
        Welcome to Acme!
      </h1>
      <p style="color:#374151;font-size:16px;line-height:24px;">
        Thanks for joining us. Your account is ready — click below to get started.
      </p>
      <a
        href="https://example.com/get-started"
        style="display:inline-block;margin-top:16px;padding:12px 20px;background:#111827;color:#ffffff;text-decoration:none;border-radius:6px;"
      >
        Get started
      </a>
    </div>
  </body>
</html>

API response:

{
  "success": true,
  "data": {
    "messageId": "01000194b1dd1c04-b51e7343-6808-4a68-b2af-845feae57f8b-000000"
  }
}

Custom from address

To send from your own domain, verify it first — see Domain Verification. Then pass from:

await fetch('https://notify.cx/api/public/v1/email/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.NOTIFY_API_KEY!
  },
  body: JSON.stringify({
    from: 'noreply@your-verified-domain.com',
    to: 'recipient@example.com',
    subject: 'Hello from your domain',
    message: 'This email is sent from your verified domain.'
  })
});

Observe delivery

After sending, track the message:

Save the messageId from the response to correlate sends with log entries and webhook events.

Next steps