WRNexusDocs
Theme
Accent color
Language

← Email

POST /email/send

Send email

Send an email from an assigned sender. Version v1.

Parameters

NameBodyDescription
toPOSTRecipient's phone number (WhatsApp) or email address (Email), in E.164 or standard email format.
senderKeyPOSTA verified email sender address or domain key.
fromNamePOSTDisplay name shown to the recipient.
subjectPOSTEmail subject line.
htmlBodyPOSTHTML body. Provide htmlBody, textBody, or both.
textBodyPOSTPlain-text body. Provide htmlBody, textBody, or both.
templateIdPOSTA saved email template id, used instead of htmlBody/textBody.
requestKeyPOST

Request

curl -X POST "https://api.wrnexus.com/email/send" \
  -H "Authorization: Bearer $WRNEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "customer@example.com",
  "senderKey": "billing@yourdomain.com",
  "fromName": "Your Business",
  "subject": "Your invoice is ready",
  "htmlBody": "<p>Hi there, your invoice #1042 is attached.</p>",
  "textBody": "Hi there, your invoice #1042 is attached."
}'

Body

{
  "to": "customer@example.com",
  "senderKey": "billing@yourdomain.com",
  "fromName": "Your Business",
  "subject": "Your invoice is ready",
  "htmlBody": "<p>Hi there, your invoice #1042 is attached.</p>",
  "textBody": "Hi there, your invoice #1042 is attached."
}

Response

200 (or 201 for a new send) on success:

{
  "ok": true,
  "messageId": "em_4a7d2f9c",
  "status": "queued",
  "message": "Queued.",
  "requestId": "req_2e9c4a"
}

Errors

Every error uses the same envelope, with a stable error.code to branch on and a requestId to reference when contacting support:

{
  "ok": false,
  "error": {
    "code": "operation-not-allowed",
    "message": "This API key is not allowed to use sms/send."
  },
  "requestId": "req_0f2a9c"
}
StatusCodeMeaning
401api-key-required / api-key-invalidMissing, invalid, revoked or expired key.
403operation-not-allowedThe key isn't scoped for this app/operation.
403kyc-requiredThe organization hasn't completed identity verification.
403ip-not-allowedThe caller's address isn't on the allowed list.
404message-not-foundNo message with that id for this organization.
429rate-limitedToo many requests for this key in the last minute.
502app-unavailableThe app didn't respond. Safe to retry.