Skip to content

Sending model

A POST /emails call goes through these stages:

  1. Validationfrom domain checked against your verified domains; bearer key checked for permission and (if scoped) domain match.
  2. Suppression check — recipient checked against the suppression list. Hard bounces and complaints from the past 90 days are blocked at this step.
  3. Persistence — an emails row is created in Postgres with status queued. The API call returns immediately.
  4. Queue — an arq job is enqueued in Redis.
  5. Worker pickup — a send_email worker dequeues the job, picks an IP from the appropriate pool (round-robin within the pool, weighted by health score), and renders the MIME message including DKIM signing.
  6. SMTP delivery — the worker connects to one of your SMTP relays (rotated to match the chosen IP), submits the message, and waits for the receiving MTA’s response.
  7. Status update — accepted by the MTA → status becomes sent. Rejected → status becomes failed with the SMTP reason logged.
  8. Webhook fireemail.sent event is enqueued for every webhook subscribed to it.
  9. VERP bounce processing — bounce-back emails to the unique VERP address are matched to the original email and update its status to bounced. Hard bounces add the recipient to suppressions.
  10. Open / click tracking — when the recipient opens (loads the tracking pixel) or clicks (hits the redirect endpoint), the corresponding event is recorded and a webhook fires.

Two layers:

  • Per-account: 50 requests/sec on POST /emails (returns 429 if exceeded).
  • Per-IP daily limit: each IP has a daily_limit set by its warmup phase. If all IPs in the chosen pool hit their cap, the worker holds the job and retries on the next minute boundary.

If SMTP submission fails with a transient error (4xx code), the worker retries with exponential backoff for up to 72h. Permanent failures (5xx code, or DNS-level rejection) mark the email as failed immediately.

Pass an Idempotency-Key header with POST /emails to dedupe within a 24h window. See Idempotency.