Skip to content

Send batch of different emails

Request

Send up to 500 completely different emails in a single API call.

Batch sending where each email can have:

  • Different recipient
  • Different subject
  • Different content
  • Different settings
  • File attachments
  • Calendar invites

Perfect for sending multiple transactional emails at once (order confirmations, password resets, etc.).

Limits:

  • Maximum 500 emails per batch
  • Each email validated independently
  • Failed emails don't affect successful ones

Use cases:

  • Sending different transactional emails simultaneously
  • Mixed email types in one API call
  • High-volume transactional sending

Not for: Newsletter-style emails with same content → Use /api/bulk-send instead

Idempotent retries: Pass an Idempotency-Key header (or idempotency_key body field) so a retried batch is not sent twice. Retrying with the same key within 24 hours replays the original response (X-Idempotent-Replay: true) instead of re-sending the batch. A retry while the original is still processing returns 409 Conflict. Keys are scoped to your account.

Security
ApiKeyAuth
Headers
Idempotency-Keystring, <= 255 characters

Unique key for safe retries. Retrying with the same key within 24 hours replays the original response instead of re-sending the batch.

Example:batch-2026-07-08-run-1
Bodyapplication/jsonrequired
campaign_idstring

Optional campaign identifier for grouping related emails and tracking bounce rates.

Auto-pause protection: If bounce rate exceeds thresholds, the campaign will be automatically paused to protect IP reputation.

Best practice: Provide this when sending related batches (e.g., "daily-digest", "order-notifications-batch").

If not provided, system auto-generates: batch-{timestamp}-{customer_id}

Example:"order-confirmations-batch-2026-02-27"
emailsArray of objects, <= 500 itemsrequired

Array of emails to send (max 500)

curl -i -X POST \
  https://api.mailerlogic.net/api/v1/batch \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: batch-2026-07-08-run-1' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "emails": [
      {
        "to": "user1@example.com",
        "subject": "Order #12345 Confirmed",
        "html": "<h1>Thanks for your order!</h1><p>Order #12345</p>",
        "text": "Thanks for your order! Order #12345",
        "tag": "order-confirmation",
        "stream_type": "transactional",
        "metadata": {
          "order_id": "12345"
        }
      },
      {
        "to": "user2@example.com",
        "subject": "Password Reset Request",
        "html": "<h1>Reset Password</h1><p><a href='\''https://...'\''>Click here</a></p>",
        "text": "Reset your password: https://...",
        "tag": "password-reset",
        "stream_type": "transactional"
      },
      {
        "to": "user3@example.com",
        "from": "welcome@mail.yourdomain.com",
        "from_name": "Welcome Team",
        "subject": "Welcome to our platform!",
        "html": "<h1>Welcome!</h1>",
        "text": "Welcome!",
        "tag": "welcome",
        "stream_type": "transactional"
      }
    ]
  }'

Responses

Batch processed (may include partial failures)

Bodyapplication/json
totalinteger

Total emails in batch

queuedinteger

Successfully queued emails

failedinteger

Failed emails

resultsArray of objects

Successfully queued emails

errorsArray of objects

Failed emails (only if any failed)

Response
{ "total": 2, "queued": 2, "failed": 0, "results": [ {}, {} ] }