MepMail Docs
API referenceEndpointsEmailsBatch

Send a batch of emails

POST
/emails/batch

Queues up to 100 different emails in one request; each item is a send request.

AuthorizationBearer <token>

An API key from the dashboard (ms_…), sent as Authorization: Bearer. A sending-only key reaches the /emails routes only.

In: header

Header Parameters

Idempotency-Key?string

Optional retry key, scoped to the team across single and batch sends for 24 hours from the initial claim. The same key and canonical payload replay the original email ids; a different payload returns 409 invalid_idempotent_request and a request still processing returns 409 concurrent_idempotent_requests. An incomplete claim can be recovered after 10 minutes. After expiry, the key can accept a new send. This is an HTTP header, not an email header.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Items1 <= items <= 100
[index: integer]?unknown

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/emails/batch" \  -H "Idempotency-Key: order-123-confirmation" \  -H "Content-Type: application/json" \  -d '[    {      "from": "Acme <hello@yourdomain.com>",      "to": [        "customer@example.com"      ],      "subject": "Your order has shipped",      "html": "<p>Your order is on its way.</p>"    },    {      "from": "Acme <hello@yourdomain.com>",      "to": [        "another@example.com"      ],      "subject": "Your order has shipped",      "html": "<p>Your order is on its way.</p>"    }  ]'
{  "data": [    {      "id": "ae2014de-c168-4c61-8267-70d2662a1ce1"    },    {      "id": "faccb7a5-8a28-4e9a-ac64-8da1cc3bc1cb"    }  ]}