Send a batch
const url = 'https://api.vaartix.com/emails/batch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"from":"Acme <[email protected]>","to":["example"],"cc":["example"],"bcc":["example"],"replyTo":["example"],"subject":"example","html":"example","text":"example","headers":{"additionalProperty":"example"},"tags":[{"name":"category","value":"receipt"}]}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vaartix.com/emails/batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "from": "Acme <[email protected]>", "to": [ "example" ], "cc": [ "example" ], "bcc": [ "example" ], "replyTo": [ "example" ], "subject": "example", "html": "example", "text": "example", "headers": { "additionalProperty": "example" }, "tags": [ { "name": "category", "value": "receipt" } ] } ]'Up to 100 emails in one request. All emails are validated first: if any is invalid, none
are sent and the error message starts with its index, for example [3]. Batch emails
cannot have attachments or scheduledAt.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Must be on a domain your team has verified (or a subdomain of it), or test.vaartix.com for test mode.
Example
Acme <[email protected]>HTML body. Provide html, text or both.
Plain-text body.
Custom headers such as List-Unsubscribe. Standard headers (From, To, Subject, …) cannot be set.
object
object
Example
categoryExample
receiptResponses
Section titled “Responses”All emails are queued, in the same order as the request.
object
object
Example
{ "data": [ { "id": "em_7hq2kv9xr4m1c8d3" } ]}validation_error: the request is invalid. The message says which field and why.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error", "message": "to: \"priya@\" is not a valid email address." }}unauthorized: the API key is missing, invalid or revoked.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}forbidden: the key cannot do this, for example a send-only key on a management endpoint.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}rate_limited: more than 10 requests in one second (see the Retry-After header).
daily_quota_exceeded: your team’s daily limit is used up; it resets at midnight IST.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}Headers
Section titled “Headers”Seconds to wait before retrying (rate limits only).