Quickstart

Send your first email in about five minutes. You need a Mailfy account and, for real delivery, a domain whose DNS you can edit.

1. Create an API key

In the dashboard open API keys and create a key. mf_test_… keys run the whole pipeline — validation, templates, quotas, webhooks — but never deliver, so you can integrate before your domain is ready. mf_live_… keys deliver real email. The secret is shown once; store it as an environment variable.

Shell
export MAILFY_API_KEY=mf_test_…

2. Send a test email

Terminal
curl https://api.mailfy.uz/v1/emails \
  -H "Authorization: Bearer $MAILFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@acme.com>",
    "to": "ada@example.com",
    "subject": "Welcome, {{ name }}",
    "html": "<p>Thanks for signing up, {{ name }}!</p>",
    "variables": { "name": "Ada" }
  }'

The response comes back as soon as the email is accepted. With a test key its status ends at SANDBOXED; with a live key it moves through QUEUED → SENT → DELIVERED (or BOUNCED).

202 Accepted
{ "data": { "id": "6f1c…", "status": "QUEUED" } }

3. Verify your domain

Add your domain under Domains and publish the records shown (DKIM, SPF and an MX for the return path). Mailfy checks DNS automatically. Live keys can only send from verified domains. See Domains.

4. Go live

Swap in a live key. Add an webhook endpoint if you want to react to deliveries and bounces, and use an Idempotency-Key header so retries never send twice.

Prefer a library? The Node.js and Python SDKs wrap the same API with typed errors and safe retries.