Skip to content

Send a batch

POST
/emails/batch
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.

Media typeapplication/json
Array<object>
>= 1 items <= 100 items
object
from
required

Must be on a domain your team has verified (or a subdomain of it), or test.vaartix.com for test mode.

string

Example

to
required
One of:
string
cc
One of:
string
bcc
One of:
string
replyTo
One of:
string
subject
required
string
<= 998 characters
html

HTML body. Provide html, text or both.

string
text

Plain-text body.

string
headers

Custom headers such as List-Unsubscribe. Standard headers (From, To, Subject, …) cannot be set.

object
key
additional properties
string
tags
Array<object>
<= 10 items
object
name
required
string
/^[A-Za-z0-9_-]{1,256}$/

Example

category
value
required
string
/^[A-Za-z0-9_-]{1,256}$/

Example

receipt

All emails are queued, in the same order as the request.

Media typeapplication/json
object
data
required
Array<object>
object
id
required
string

Example

{
"data": [
{
"id": "em_7hq2kv9xr4m1c8d3"
}
]
}

validation_error: the request is invalid. The message says which field and why.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error",
"message": "to: \"priya@\" is not a valid email address."
}
}

unauthorized: the API key is missing, invalid or revoked.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}

forbidden: the key cannot do this, for example a send-only key on a management endpoint.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

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.

Media typeapplication/json
object
error
required
object
type
required

Stable, machine-readable error type.

string
Allowed values: validation_error unauthorized forbidden not_found conflict rate_limited daily_quota_exceeded domain_not_verified invalid_from_address account_paused idempotency_conflict bad_request internal_error
message
required

Human-readable explanation, safe to show to developers.

string

Example

{
"error": {
"type": "validation_error"
}
}
Retry-After
integer

Seconds to wait before retrying (rate limits only).