Docs/Send Email

Send Email

Send a single transactional email using the FWD API. Supports HTML content, plain text, template rendering, custom sender domains, and reply-to addresses.

POST/api/send

Authentication

Include your API key in the x-api-key request header. Keys are created in the dashboard and have a fwd_ prefix.

Request Body

ParameterTypeRequiredDescription
tostringRequiredRecipient email address
subjectstringRequiredEmail subject line (not required if using templateId)
htmlstringRequiredHTML email body (or provide text, or use templateId)
textstringOptionalPlain text fallback body
fromstringOptionalCustom sender address (requires verified domain)
replyTostringOptionalReply-to email address
templateIdstringOptionalUse a saved template by ID
variablesobjectOptionalKey-value pairs for template variable substitution

Example Request

cURL
curl -X POST https://fwd.sarthak.online/api/send \
  -H "x-api-key: fwd_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "user@example.com",
    "subject": "Order Confirmed",
    "html": "<h1>Order #1234</h1><p>Your order has been confirmed.</p>",
    "replyTo": "support@yourcompany.com"
  }'

Using Templates

Instead of providing subject and html directly, reference a saved template by ID and pass variables for dynamic content.

Template-based send
curl -X POST https://fwd.sarthak.online/api/send \
  -H "x-api-key: fwd_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "user@example.com",
    "templateId": "tmpl_abc123",
    "variables": {
      "name": "John",
      "orderNumber": "#1234"
    }
  }'

Custom From Address

By default, emails are sent from noreply@fwd.sarthak.online. To send from your own domain, first verify it in the Domains section, then pass the from field.

Custom sender
{
  "to": "user@example.com",
  "from": "Hello Team <hello@yourdomain.com>",
  "subject": "Welcome!",
  "html": "<p>Hello from our domain.</p>"
}

Response

FieldTypeDescription
successbooleanWhether the email was accepted
emailIdstringUnique identifier for this email
messageIdstringQueue message ID
statusstring"queued" in production, "sent" in development
rateLimit.limitnumberYour monthly email limit
rateLimit.remainingnumberEmails remaining this month

Suppression List

Emails to addresses on the suppression list (bounced or complained) are automatically blocked and return a 400 error. This protects your sender reputation.

Open tracking

FWD automatically injects a 1×1 tracking pixel into HTML emails to track opens. Unsubscribe links are also injected for CAN-SPAM compliance in batch emails.