POST /api/v2/emails

The email API for developers who ship

A simple email API: send receipts, sign-in links and alerts with one HTTPS request. Test keys that never deliver, safe retries with idempotency keys, batches of 100 and a searchable log of every email, on the same plan as your marketing campaigns.

const res = await fetch("https://robustemail.com/api/v2/emails", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.ROBUSTEMAIL_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": "order-1042",
  },
  body: JSON.stringify({
    from: "Acme <orders@acme.com>",
    to: "jane@example.com",
    subject: "Order #1042 confirmed",
    html: "<p>Thanks for your order!</p>",
  }),
});

const { id } = await res.json();
200 OK {"id": "6adc79043cbea"}

Built the way you would build it

A small API that does the important things right.

Test mode that never delivers

rb_test_ keys accept real requests and simulate the outcome. Send to bounced@ or complained@ the sandbox domain to see every case.

Safe retries

Send an Idempotency-Key header and a retried request returns the first email instead of sending twice, for 24 hours.

Batch sending

Up to 100 different emails in one call to POST /api/v2/emails/batch, each with its own recipients and content.

An email log you can search

Every email with its events (queued, sent, delivered, delayed, bounced, complained) in the dashboard and through the API.

Scoped API keys

Sending-only or full-access keys, limited to one domain if you like. Shown once, revocable any time.

Attachments, cc, bcc and tags

Base64 attachments up to 40 MB, inline images by content ID, custom headers, and tags to find emails later.

Your first email in three steps

From API key to your first test email, with nothing to install.

  1. Create an API key

    Developers › API keys in the dashboard. Start with a test key.

  2. Verify your domain

    Publish the DKIM record so mail is signed as you. How.

  3. Send

    POST to /api/v2/emails, then switch to your live key.

Send in batches

Digests, notifications and reminders: up to 100 different emails per request, validated as a whole before anything is sent.

Batch reference
POST /api/v2/emails/batch
curl -X POST https://robustemail.com/api/v2/emails/batch \
  -H "Authorization: Bearer $ROBUSTEMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "from": "Acme <hello@acme.com>",
      "to": "jane@example.com",
      "subject": "Your weekly summary",
      "html": "<p>Hi Jane, here is your week.</p>"
    },
    {
      "from": "Acme <hello@acme.com>",
      "to": "sam@example.com",
      "subject": "Your weekly summary",
      "html": "<p>Hi Sam, here is your week.</p>"
    }
  ]'

Endpoints

MethodPathWhat it doesKey
POST /api/v2/emails Send one email sending
POST /api/v2/emails/batch Send up to 100 emails sending
GET /api/v2/emails List emails, filter by status full
GET /api/v2/emails/{id} One email with its events full
GET /api/v2/domains Your sending domains full
POST /api/v2/api-keys Create, list and revoke keys full
POST /api/v2/email-validations Validate an address, or a batch sending

Managing lists and campaigns from code? See the marketing API.

Guides for your stack

Copy-and-paste examples for 23 languages and frameworks. If it can make an HTTPS request, it can send email.

Developer questions

Is the email API included in my plan?

Yes. API emails come out of the same monthly volume as your campaigns, so marketing and transactional email are on one bill. See pricing.

Do you have SDKs?

Not yet. The API is plain HTTPS and JSON, so any HTTP client works. The docs have copy-and-paste guides for Node.js, Python, PHP, Ruby, Go, Java, C# and Rust, and frameworks such as Django, Rails, Laravel, Next.js and SvelteKit.

Can I test without sending real email?

Yes. Use a test key, or send to an address at sandbox.robustemail.dev. Test mode and sandbox.

Which domain can I send from?

Any domain you verify with a DKIM record. Verify your domain.

How fast can I send?

Up to 600 requests a minute per API key, and up to 100 emails per batch request. Rate limits.

One plan for campaigns and API email

From $12 a month for 15,000 emails.

Get an API key