Transactional

Send a batch of emails

Changed on

Queues up to 100 emails in one request and reports a result per item. Items are independent: one invalid address, unverified sender or suppressed recipient is reported at its index and the rest are queued. The response is 200 whenever the batch itself was accepted, even if every item was refused; read each entry's error.

Limits. The whole batch's sends (one per to, cc and bcc address across every item) are reserved against your plan before any item is looked at. A batch that does not fit is refused with 429 monthly_quota_exceeded and nothing is sent, so a retry can never half-send. Sends for refused items, test addresses and replays are returned. A batch request counts as one request against the 5 per second and 300 per minute rate limit; the plan's sends are what bound volume.

Idempotency. Two levels. An Idempotency-Key header makes the whole batch replayable for 24 hours: the same key with the same emails returns the original results with idempotent-replayed: true; a different body is a 409 invalid_idempotent_request. A per-item idempotency_key protects each email on its own, exactly like the header on POST /transactional/emails, and is the one to rely on when your retry may be built from a different batch.

Sandbox, test addresses and tags work per item as on the single route.

post/transactional/emails/batch

Request

  • Base URL
    https://api.sendfox.com
  • Auth
    OAuth 2
    Authorization codehttps://sendfox.com/oauth/authorize
    Token URLhttps://sendfox.com/oauth/token

Headers

Idempotency-Keystring

Request body

Example request

{
  "emails": [
    {
      "from": "Acme <hello@mail.acme.com>",
      "to": [
        "jane@example.com"
      ],
      "subject": "Your login code",
      "html": "<p>Your code is <strong>483 920</strong>.</p>",
      "tag": "login_code",
      "headers": {
        "List-Unsubscribe": "<https://acme.com/unsubscribe?u=4f0c>, <mailto:unsub@acme.com>",
        "List-Unsubscribe-Post": "List-Unsubscribe=One-Click"
      },
      "attachments": [
        {
          "filename": "invite.ics",
          "content_type": "text/calendar; method=REQUEST"
        }
      ]
    }
  ]
}

Response

Batch accepted; one result per item

Example response

{
  "data": [
    {
      "id": "tm_4f0c9b2e7d1a5c3e8b6f2a9d",
      "status": "queued",
      "error": {
        "status": 422,
        "name": "validation_error"
      }
    }
  ]
}

Changes

    • warning

      the optional response header x-sendfox-daily-quota-remaining removed for the status 200

    • warning

      the optional response header x-sendfox-monthly-quota-remaining removed for the status 200

    • info

      added the new optional request property //////