Developer API

Send through NR Mail

A small, authenticated transactional email API for plain-text and HTML delivery.

POST /api/v1/email/send

202 accepted

Base URL: https://your-domain.example

curl -X POST /api/v1/email/send \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"from":"Your App <sender@example.com>","to":["user@example.com"],"subject":"Welcome","text":"Hello from our API","html":"<h1>Hello</h1><p>Welcome!</p>"}'

Authentication

Send the generated key as a Bearer token or x-api-key. Keys are hashed server-side and shown only once.

Request fields

FieldRequiredDetails
fromnoConfigured verified sender
toyesEmail or array, max 50
cc / bccnoEmail or array
subjectyesMax 998 characters
textonePlain-text body
htmloneHTML body, max 500 KB
replyTonoReply address
attachmentsnoNodemailer attachment objects

Response

{
  "success": true,
  "requestId": "...",
  "messageId": "...",
  "status": "accepted"
}

Status codes

400 invalid request
401 missing or invalid key
403 disabled or expired key
413 payload too large
429 quota or rate limit exceeded
502 provider delivery failure

Quota behavior

Daily, monthly, lifetime, and hourly limits are checked before delivery. Usage is recorded with request ID, recipient count, result, status, and provider code, without storing message content.

JavaScript

await fetch("/api/v1/email/send", {
  method: "POST",
  headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    to: ["user@example.com"], subject: "Welcome",
    text: "Hello from our API", html: "<h1>Hello</h1>"
  })
});