Voyant Networks Docs

Send Emails via API (Transactional Email Guide)

Send transactional emails like OTPs, welcome messages, alerts, and custom emails using Voyant Email API with secure signature-based authentication.

Base URL: https://api.voyantnetworks.com
Endpoint:
• /v1/email/send

Authentication

All requests must be signed using your apiSecret . Send signature in header x-signature .

Required fields in body:

  • • projectId
  • • apiKey
  • • nonce (random alphanumeric exactly 10 characters)
  • • timestamp
  • • emailData (full object)

⚠️ Entire emailData must be included in signature calculation.
⚠️ Enum values are case-sensitive.

Field Values (Enums)

fromType → verify | noreply | support | alerts | billing | updates
language → en | hi | es | fr | de | pt | ru | ja
button.type → filled | outlined | text

Signature Generation

1. POST request (application/json)
2. Include required fields + emailData
3. Create payload with ALL fields
4. Sort keys
5. HMAC-SHA256 using apiSecret
6. Send in x-signature header

import crypto from "node:crypto";

const payload = { nonce, projectId, apiKey, timestamp, emailData };

const stable = JSON.stringify(
  Object.keys(payload).sort().reduce((a,k)=>{a[k]=payload[k];return a;}, {})
);

const signature = crypto
  .createHmac("sha256", apiSecret)
  .update(stable)
  .digest("hex");

⚠️ emailData must be included in signature calculation.

Template Examples (Full)

All fields shown. Optional fields marked clearly.

{
  "to": "user@email.com",
  "language": "en", // optional → en | hi | es | fr | de | pt | ru | ja
  "detectLocation": true, // optional (default: false)
  "requestId": "req_123", // optional
  "fromType": "verify", // required → verify | noreply | support | alerts | billing | updates
  "replyTo": "support@example.com", // optional

  "templateName": "email_verification",
  "templateData": {
    "username": "John", // optional
    "otp": "123456", // optional (auto-generated if missing)
    "expiryMinutes": 10, // optional (default: 10)
    "deviceText": "Chrome on Windows" // optional
  }
}
• nonce must be exactly 10 characters
• OTP auto-generated if not provided
• Rate limits apply
• Invalid signature → request fails