Skip to main content

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.

Private beta

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

  1. Verify a sender domain.
  2. Create a Project API Key in Console.
  3. 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

DataRetention
Email details and event timelines90 days after acceptance
Aggregate statisticsAvailable in 7-day, 30-day, or 90-day query windows
Email content and attachmentsRemoved after processing where possible; retained queued or failed payloads become eligible for deletion after 30 days
Hard-bounce suppressions90 days, unless removed earlier
Complaint suppressionsNo automatic expiration; cannot be removed through the API
Manual suppressionsUntil 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