Sending Emails
Send single and batch transactional emails with the Wistfare Mail API.
Send a Single Email
POST /api/v1/emails
Scope: emails:send
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Sender email (must match verified domain) |
to | string | string[] | Yes | Recipient(s), max 50 |
subject | string | Yes | Subject line, max 998 chars |
html | string | No | HTML body |
text | string | No | Plain text body |
cc | string | string[] | No | CC recipients |
bcc | string | string[] | No | BCC recipients |
replyTo | string | string[] | No | Reply-To address(es) |
headers | object | No | Custom email headers |
attachments | array | No | File attachments, max 20 |
tags | object | No | Key-value tags for tracking |
scheduledAt | string | No | ISO 8601 date for delayed sending |
templateId | string | No | Template ID to use |
variables | object | No | Template variable values |
Attachments
Each attachment has:
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | File name |
content | string | Yes | Base64-encoded content |
contentType | string | No | MIME type (auto-detected if omitted) |
Example
Response
Batch Send
POST /api/v1/emails/batch
Scope: emails:send
Send up to 100 emails in a single request.
Get Email Status
GET /api/v1/emails/:id
Scope: emails:read
Response
Email Statuses
| Status | Description |
|---|---|
queued | Email accepted, waiting to be sent |
sending | Being processed by mail engine |
sent | Handed off to recipient's mail server |
delivered | Confirmed delivered to inbox |
bounced | Delivery failed (hard or soft bounce) |
failed | Sending error |
complained | Recipient marked as spam |
Cancel Scheduled Email
PATCH /api/v1/emails/:id/cancel
Cancel an email that was scheduled for future delivery.