← Emailyt

Transactional email API guide for developers

A practical reliability and security checklist for product email.

Transactional email is part of an application’s critical path. Password resets, sign-in links, receipts, security alerts, and account notifications need more than a successful HTTP request: they need durable acceptance, safe retries, sender authentication, delivery feedback, and controls that prevent one integration error from becoming a reputation or cost incident.

Separate acceptance from delivery

An email API should return success only after the request is validated and stored durably. Delivery happens asynchronously because mailbox providers can defer or reject mail. Keep the returned message ID and use it across logs, activity records, delivery events, and support requests.

Make every retry idempotent

Networks fail at inconvenient boundaries. Send a stable Idempotency-Key for each logical email and reuse it only with the same payload. A sound API resumes pending work and returns the original message ID after completion, preventing duplicate receipts or password-reset messages.

Verify sending domains

Domain verification proves control and enables DKIM signing. Publish every required DNS record, wait for propagation, and do not enable live sending until verification succeeds. Do not use a transactional system for purchased lists or unsolicited outreach.

Handle suppressions before acceptance

Permanent bounces and complaints should enter an account-scoped suppression list. Check all To, Cc, and Bcc recipients before reserving quota or archiving content. Never remove complaint suppressions merely to retry traffic.

Count recipients, not requests

Email providers typically charge and enforce reputation by recipient. A request with multiple recipients must consume the corresponding allowance atomically. Apply monthly, daily, and credential controls before work enters the delivery queue.

Use test mode deliberately

Test mode should exercise validation, persistence, activity, and webhooks without calling the delivery provider. It still consumes storage and compute, so it needs its own bounded allowance.

Verify webhook signatures

Read the raw request body, reject stale timestamps, compute HMAC-SHA256 over timestamp + "." + rawBody, compare in constant time, and deduplicate by event ID. Return a 2xx response quickly and move expensive work to your own queue.

Minimize retained content

Store message bodies only as long as customers need them. Keep metadata and events on explicit retention schedules, encrypt data in transit and at rest, and avoid placing bodies, recipients, API keys, or authorization headers in logs.

Send with Emailyt

POST https://api.emailyt.com/v1/emails
Authorization: Bearer $EMAILYT_API_KEY
Idempotency-Key: order-123-receipt
Content-Type: application/json

{"from":"receipts@example.com","to":["customer@example.net"],"subject":"Your receipt","text":"Thanks for your order."}

Continue with the Emailyt API reference, retry and error guide, and webhook verification guide.