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/requestRequires Bearer authentication.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
tenantId | string | Yes | Your tenant identifier. |
recipientEmail | string | Yes | The recipient's email address. |
templateId | string | Yes | The template to use for this send. |
dedupeKey | string | Yes | A unique key to prevent duplicate sends. The same key will be rejected as duplicate. |
payload | object | Yes | Template variables and email content. |
Payload fields
The payload object contains your email content and any template variables:
| Field | Type | Description |
|---|---|---|
subject | string | The email subject line. |
html | string | The HTML body of the email. |
text | string | Plain text fallback body. |
| custom keys | any | Any additional variables your template expects. |
Example request
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}.