MOLTED EMAIL

Sending Email

Send email via POST /v1/send/request with policy enforcement and delivery tracking.

The core API endpoint for sending email through Molted Email.

Endpoint

POST https://api.molted.email/v1/send/request

Requires Bearer authentication.

Request body

FieldTypeRequiredDescription
tenantIdstringYesYour tenant identifier.
recipientEmailstringYesThe recipient's email address.
templateIdstringYesThe template to use for this send.
dedupeKeystringYesA unique key to prevent duplicate sends. The same key will be rejected as duplicate.
payloadobjectYesTemplate variables and email content.

Payload fields

The payload object contains your email content and any template variables:

FieldTypeDescription
subjectstringThe email subject line.
htmlstringThe HTML body of the email.
textstringPlain text fallback body.
custom keysanyAny additional variables your template expects.

Example request

curl
curl -X POST https://api.molted.email/v1/send/request \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "tenant_abc123",
    "recipientEmail": "user@example.com",
    "templateId": "order-confirmation",
    "dedupeKey": "order-456-user@example.com",
    "payload": {
      "subject": "Your order has been confirmed",
      "html": "<h1>Order Confirmed</h1><p>Thank you for your purchase.</p>",
      "text": "Order Confirmed. Thank you for your purchase.",
      "orderId": "456",
      "customerName": "Jane"
    }
  }'

Response

Queued (success)

{
  "requestId": "req_abc123",
  "status": "queued"
}

The email has passed all policy checks and is queued for delivery.

Blocked

{
  "requestId": "req_abc123",
  "status": "blocked",
  "reason": "rate_limited"
}

The email was rejected by the policy engine. See Errors & Policy Blocks for all possible reason values.

Deduplication

The dedupeKey field prevents sending the same email twice. If you submit a request with a dedupeKey that has already been used, the request is blocked with reason duplicate.

Use a deterministic key based on the action — for example, {templateId}-{recipientEmail} or {orderId}-{recipientEmail}.