Email Sending
Send transactional emails such as receipts, password resets, and account notifications from your application using Unlayer's v3 Cloud API. Use raw HTML or a saved template, send from a verified domain, and track delivery with webhooks.
Email Sending requires beta access. Contact us to request access for your workspace. Requests to Send endpoints require this access in addition to the endpoint's authentication and permissions.
Get started
- Verify a sender domain.
- Create a Project API Key in Console.
- Send an email:
curl -X POST https://api.unlayer.com/v3/emails \
-H "Authorization: Bearer unlayer_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <hello@mail.example.com>",
"to": ["customer@example.com"],
"subject": "Welcome to Acme 👋",
"html": "<h1>Hello!</h1><p>Thanks for signing up.</p>"
}'
A successful new send returns 202 Accepted with an email id and status: "queued".
This confirms acceptance, not delivery. Use webhooks
or GET /v3/emails/{id} to follow its progress.
Authentication
Use https://api.unlayer.com/v3 as the base URL. Sending, history, settings,
suppressions, statistics, and webhooks accept a Bearer Project API Key (unlayer_sk_).
The key identifies the project; you do not need a projectId parameter.
Sender-domain management requires an owner/admin
Personal Access Token (unlayer_pat_) and project context because domains are shared
by a workspace.
Keep tokens on your server. Do not include them in browser or mobile application code. See Authentication for details.
Data retention
| Data | Retention |
|---|---|
| Email details and event timelines | 90 days after acceptance |
| Aggregate statistics | Available in 7-day, 30-day, or 90-day query windows |
| Email content and attachments | Removed after processing where possible; retained queued or failed payloads become eligible for deletion after 30 days |
| Hard-bounce suppressions | 90 days, unless removed earlier |
| Complaint suppressions | No automatic expiration; cannot be removed through the API |
| Manual suppressions | Until removed |
Deletion is asynchronous. Do not rely on history remaining available beyond 90 days. For a longer audit trail, verify and store webhook events.
Guides
- Sender domains: register a domain and configure DNS.
- Sending emails: HTML, templates, attachments, retries, and credits.
- Deliverability and settings: sender names and suppression management.
- Webhooks and events: delivery updates, signatures, and statistics.
- API reference: endpoint fields and responses.