Skip to main content
Use the HTTP Sending API for new integrations, batch sending, and retry-safe requests.
Routing follows the send-only key or mailbox key you authenticate with. You cannot choose a provider or delivery group inside an individual send request.
Managed Amazon SES is for transactional email only. Use your own provider for marketing, newsletters, or bulk promotional sends.

Prerequisites

  • A team with sending access.
  • A send-only key or mailbox key with email.send.
  • Enough team balance for the messages you send.
  • A verified custom domain, unless you are testing with the shared domain.

Send one email

curl -X POST https://smtp.sendmux.ai/api/v1/emails/send \
  -H "Authorization: Bearer smx_mbx_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "from": { "email": "hello@example.com", "name": "Your App" },
    "to": { "email": "user@example.com", "name": "Jane Doe" },
    "subject": "Welcome",
    "html_body": "<p>Thanks for signing up.</p>",
    "text_body": "Thanks for signing up."
  }'
A successful request returns 201 Created with a queued message_id.

Send a batch

Send up to 100 messages in one request. The response reports each message by its input index.
curl -X POST https://smtp.sendmux.ai/api/v1/emails/send/batch \
  -H "Authorization: Bearer smx_mbx_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "from": { "email": "hello@example.com" },
        "to": { "email": "alice@example.com" },
        "subject": "Hello Alice",
        "html_body": "<p>Hi Alice.</p>"
      },
      {
        "from": { "email": "hello@example.com" },
        "to": { "email": "bob@example.com" },
        "subject": "Hello Bob",
        "html_body": "<p>Hi Bob.</p>"
      }
    ]
  }'

Useful options

OptionUse it for
cc, bccAdd more recipients. Each list can contain up to 100 recipients.
reply_toDirect replies to a different address.
return_pathSet the envelope sender for bounce handling.
custom_headersAdd custom X-* headers to the outgoing message.
attachmentsAttach files as base64 content.
Idempotency-KeySafely retry a request without sending twice.
See the Sending API reference for the full schema.

Error handling

Check the ok field. If it is false, read error.code, error.message, and meta.request_id.
const data = await response.json();

if (!data.ok) {
  console.error(data.error.code, data.error.message, data.meta.request_id);
}
Use Sending API errors for retry and support guidance.

SMTP sending

Use SMTP when an existing tool only supports SMTP delivery.

Attachments

Add files to HTTP send requests.

Idempotency

Make send retries safe with Idempotency-Key.

Sending accounts

Connect providers and control routing before you send.