Glossary

What is an email API?

Short answer

An email API is a web service that lets your application send email, and often receive it, by making HTTPS requests with JSON instead of speaking SMTP. You authenticate with an API key, post the sender, recipient, subject and body, and get back a message id. The provider handles delivery, DKIM signing, bounces and retries, and reports results to you by webhook.

Last checked 16 November 2026

An email API is a web service that lets your application send email, and often receive it, by making HTTPS requests instead of speaking SMTP directly. You send JSON describing the message, the provider returns an id, and it takes care of signing, delivery, retries and bounce handling. Most modern transactional email is sent this way.

How an email API works

  1. Authenticate. Every request carries an API key, usually as Authorization: Bearer <key>.
  2. Send a request. You POST the from address, recipients, subject and HTML or text body.
  3. Get an id back. The API validates the request and queues the message. It answers in milliseconds, before delivery has happened.
  4. The provider delivers. It signs the message with DKIM and hands it to the recipient’s mail server over SMTP, retrying on temporary failures.
  5. Events come back. Delivered, bounced, complained, opened and clicked events arrive at your endpoint as webhooks.

Example request

curl https://api.mailcandor.com/v1/emails \
  -H "Authorization: Bearer $MAILCANDOR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-receipt" \
  -d '{
    "from": "Acme <billing@acme.com>",
    "to": "sam@example.com",
    "subject": "Your receipt for order 1042",
    "html": "<p>Thanks for your order.</p>"
  }'

Response:

{ "id": "9f2c1e7a-...", "status": "queued" }

The Idempotency-Key header means a retry after a timeout returns the first response instead of sending a second receipt.

Email API vs SMTP

Email API SMTP
Transport HTTPS, JSON SMTP commands over TCP
Errors Structured JSON with a field name Numeric reply codes
Per email cost One request Handshake, unless connections are pooled
Delivery events Webhooks tied to an id Usually none
Works with Any HTTP client Mail libraries, CMSs, devices

Our SMTP vs API guide goes deeper. If your software only speaks SMTP, use an SMTP relay from the same provider.

Why it matters for app email

An API turns email into an ordinary HTTP call. It works from serverless functions, it fails fast with a readable error, and every message has an id you can store next to the order or user it belongs to. That id is what lets you show “email delivered” in your admin panel or explain a bounce to a customer.

Common mistakes

  • Shipping the API key to the browser or a mobile app. Anyone can read it and send mail as you.
  • Using a full-access key everywhere. Use a key that can only send, and limit it to one domain if the provider allows it.
  • Treating 202 as delivered. Accepted means queued. Listen for delivery and bounce webhooks.
  • Retrying without an idempotency key, which sends duplicates.
  • Skipping domain verification. The API cannot fix missing SPF, DKIM and DMARC records.

How Mailcandor handles it

Mailcandor’s email API is POST /v1/emails with Bearer keys that can be full access or sending only, idempotency keys and up to 100 emails per batch request.

Questions

What is an email API key?

A secret token that identifies your account on each request, usually sent in an Authorization header. Keep it in an environment variable, never in client-side code or a git repository.

Is an email API better than SMTP?

For application email it is usually simpler: one HTTPS request per email, structured errors and delivery events by webhook. SMTP is still useful for tools and libraries that only speak SMTP.

Can I send email from the browser with an email API?

You should not. Calling the API from the browser exposes your key. Send from your server, a serverless function or a background job.

Does an email API deliver the email itself?

The provider does. Behind the API it still uses SMTP to hand the message to the recipient's mail server.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.