Email API

Transactional email
on Cloudflare.

A clean REST API built on Cloudflare Email Sending. Scoped keys, React Email templates, domain management, send history, and a full admin UI — ready in minutes.

Simple by design

One endpoint.
Infinite flexibility.

Send an email with a single HTTP request. Reference a stored template, pass variables, and EmailFlare handles rendering, delivery, and logging.

  • Bearer token authScoped API keys — not your master Cloudflare token. Prefix eflive_ for live sends, eftest_ to capture into the test mailbox instead.
  • Template or raw sendPass templateSlug / templateId with variables, or send raw html / text directly. Optional fromName and replyTo fields.
  • Multi-recipient batch"to" accepts a single address or an array of up to 50. Duplicates are deduplicated automatically.
  • Idempotency-Key supportPass an Idempotency-Key header to prevent duplicate sends on network retries — cached result returned on repeat.
  • Rate-limit headers on every response100 requests/min per key. X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset included.
See full API reference →
POST /v1/send
POST /v1/send
Authorization: Bearer eflive_xxxxxxxxxxxx
Content-Type: application/json
{
  "to": "alex@example.com",
  "from": "hello@yourdomain.com",
  "fromName": "Acme",
  "templateSlug": "welcome",
  "themeId": "ocean",
  "variables": {
    "name": "Alex",
    "loginUrl": "https://acme.com/login"
  }
}
// 200 → { results: [{ to, cfId }] }
Why EmailFlare

Everything Cloudflare Email Sending
should have shipped with.

Cloudflare Email Sending is powerful infrastructure. EmailFlare gives it the API layer, UI, and tooling that makes it ready for production teams.

Scoped keys, not root credentials

Generate per-domain or multi-domain API keys from the dashboard. Your Cloudflare API token never leaves the server — application code only ever sees an EmailFlare key.

Templates you manage, not code you maintain

Store reusable HTML templates with {{variable}} interpolation, plain-text versions, and named React Email layouts. Send by template ID — not inline HTML strings.

Full send history, zero blind spots

Every send is logged — recipient, sender, template used, API key, Cloudflare message ID, status, and error detail. Debug delivery without guessing which email was sent when.

Domain management without the CLI

Provision Cloudflare sending subdomains, inspect DKIM and return-path DNS records, and verify domain status — all from the admin dashboard instead of juggling API calls.

Rate limiting you didn't have to write

Per-key rate limiting is enforced at the API middleware layer. Rogue callers can't flood your Cloudflare quota. Limits and reset times are returned on every response.

One Worker, not an ops project

Backend, admin UI, and D1 SQLite storage are bundled in one Cloudflare Worker — no servers, no containers. A Docker image ships too for self-hosting: one volume, no Postgres, no Redis.

Comparison

EmailFlare vs. raw Cloudflare API

Cloudflare Email Sending is solid infrastructure — but a low-level API. EmailFlare is the application layer on top.

Cloudflare Email Sending
Raw API — no application layer
Raw
Complex auth & manual HTTP payload to send
Root CF token exposed in application code
No email templates — build & host yourself
No send logs or delivery visibility
No rate limiting — implement it yourself
No idempotency — duplicate sends on retries
Single recipient only per API call
No admin UI — API calls only
EmailFlare
Application layer built on Cloudflare
Recommended
Simple POST /v1/sendeflive_ or eftest_ prefix
Scoped API keys — per-domain or multi-domain, SHA-256 hashed
50 React Email layouts, 5 themes, variable interpolation
Full send history — status, errors, message IDs
100 req/min rate limiting with X-RateLimit-* headers
Idempotency-Key header — safe retries, no duplicate sends
Multi-recipient batch — up to 50 addresses per call
Full React admin UI — self-hosted, one container
Features

Every primitive you need
for production email.

EmailFlare ships with the full stack of tools for reliable transactional email — not just a thin delivery wrapper.

Domain Management

Add sending domains, provision Cloudflare subdomains, view DKIM and return-path DNS records, and track verification status — no CLI required.

Admin UI

Scoped API Keys

Create keys with global, per-domain, or multi scope. SHA-256 hashed at rest. Only the prefix is shown after creation — the full key is never stored.

Security

Email Templates

Store HTML templates with {{var}} interpolation, optional plain-text fallbacks, and an optional named layout. Send by template ID — skip the inline HTML.

Templates

React Email Layouts

50 production-ready React Email layouts ship out of the box — from Welcome and Magic Link to Invoice, Billing Receipt, Support Ticket Reply, and Incident Update. Switch between 5 built-in color themes per send.

React Email

Send Logs & Stats

Every delivery is logged with recipient, sender, template, API key, Cloudflare message ID, status, and error detail. Dashboard stats give you a live summary.

Observability

Built-in Rate Limiting

Per API-key rate limiting enforced at the middleware layer. Standard X-RateLimit-* response headers on every send request — no extra config.

Reliability

Playground & Preview

Test email sends and preview rendered templates right from the admin UI before they hit a real recipient. Catch rendering issues without burning send quota.

Developer UX

Embedded SQLite Storage

Powered by mesahub-core — embedded SQLite runs inside the container, no external database. Mount a volume at /data and persistence is handled.

Zero Ops

Railway & Docker Ready

Ships with a deploy/docker/railway.json for GitHub-connected Railway deploys, and a published image at ghcr.io/0xdps/emailflare:latest for image-based deploys.

Deploy

Test Keys & Built-in Test Mailbox

Create a test API key (eftest_) and all sends are captured in the in-house Test Mailbox — no Cloudflare credentials required. Browse, preview HTML, and manage test emails from the admin dashboard.

Local Dev
React Email Layouts

50 layouts. 5 themes. Ready to send.

Every layout is a React Email component with documented variables. Use them as-is or as a starting point for your own templates. Switch between built-in color themes per send — no CSS edits needed.

WelcomeMagic LinkOTP CodeEmail VerifyPassword ResetPassword ChangedNew Login AlertNotificationOrder ConfirmationInvoiceSubscription StartedSubscription CancelledTrial EndingTeam InviteAlertDigestAnnouncementFeedback RequestAccount DeletedPlain MessageVerification SuccessSubscription ConfirmationPayment FailedRenewal UpcomingSubscription ResumedRefund ApprovedPlan UpgradedPlan DowngradedOAuth LinkedDatabase CreatedDatabase DeletedUsage ThresholdAPI Key CreatedAPI Key RevokedPlan Limit ReachedEmail Change RequestedEmail Change ConfirmedPhone VerifyAccount LockedAccount UnlockedBackup ReadyExport ReadyImport CompletedMaintenance ScheduledIncident UpdateFeature Access GrantedFeature Access RevokedBilling ReceiptPayment Method ExpiringSupport Ticket Reply
Deploy

Deploy Email API.

Cloudflare Workers is the primary path — zero-ops, edge-native. Docker self-hosting is available for teams that want their own servers.

Serverless · Primary
Cloudflare Workers

No servers, no containers, no volumes. D1 database + KV namespace + admin UI all on the edge. One command from clone to live.

1
Clone & install

Requires Node.js, pnpm, and a Wrangler-authenticated Cloudflare account.

git clone https://github.com/0xdps/emailflarecd emailflare && just installjust emailflare-api-worker-login
2
Configure & deploy

Copy the config template, fill in your values, then run setup — creates D1, KV, runs migrations, and deploys.

cp scripts/config.example.toml scripts/config.toml# fill in CF_API_TOKEN, CF_ACCOUNT_ID, ADMIN_TOKEN just emailflare-api-worker-setup
3
You're live

Admin UI and API are served from your Workers subdomain. No separate hosting.

https://emailflare.your-subdomain.workers.dev
Container · Secondary
Docker Compose

Self-host on any VPS, server, or cloud VM. One image, one volume, full control. Published to GHCR — no local build needed.

1
Configure environment

Copy the example file and fill in credentials. Test API keys capture email into the in-house Test Mailbox — no extra services needed.

cp .env.example .env.localCF_API_TOKEN=your_cf_tokenCF_ACCOUNT_ID=your_account_idADMIN_TOKEN=$(openssl rand -hex 32)SESSION_SECRET=$(openssl rand -hex 32)
2
Pull & start

Uses the published GHCR image — no local build needed.

docker pull ghcr.io/0xdps/emailflare:latestdocker compose --env-file .env.local \  -f compose.yaml up -d
3
Open the dashboard

Admin UI on port 8090.

curl http://localhost:8090/healthhttp://localhost:8090  # admin UI