Skip to content

Batch sending

POST /emails/batch takes an array of up to 100 emails and returns their IDs in the same order.

Node.js
const { data, error } = await vaartix.batch.send([
{ from: '[email protected]', to: '[email protected]', subject: 'Order shipped', text: '...' },
{ from: '[email protected]', to: '[email protected]', subject: 'Order shipped', text: '...' },
]);
// data.data = [{ id: 'em_...' }, { id: 'em_...' }]

Every email is validated before any is accepted. If one is invalid, none are sent and the error message starts with its position:

{ "error": { "type": "validation_error", "message": "[1] to: \"rahul@\" is not a valid email address." } }
  • Up to 100 emails per request, each with up to 50 recipients.
  • No attachments or scheduledAt in batch emails.
  • The whole batch counts as one request against the rate limit; every recipient counts against the daily limit.