Skip to content

Send up to 100 emails

POST
/emails/batch
curl --request POST \
--url https://api.duta.indra.sh/v1/emails/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-batch-validation: strict' \
--data '[ { "from": { "email": "example", "name": "example" }, "to": { "email": "example", "name": "example" }, "cc": { "email": "example", "name": "example" }, "bcc": { "email": "example", "name": "example" }, "reply_to": { "email": "example", "name": "example" }, "subject": "example", "html": "example", "text": "example", "headers": { "additionalProperty": "example" }, "attachments": [ { "filename": "example", "content": { "type": "Buffer", "data": [ 1 ] }, "path": "example", "content_type": "example", "content_id": "example" } ], "tags": { "additionalProperty": "example" } } ]'

Strict by default: one invalid email and none are sent. With x-batch-validation: permissive the valid ones are sent and the rest listed in errors by index. Attachments by path are not accepted here.

Idempotency-Key
string
>= 1 characters <= 256 characters

Repeat a request safely for 24 hours. A replay carries Idempotent-Replayed: true

x-batch-validation
string
Allowed values: strict permissive
Media typeapplication/json
Array<object>
>= 1 items <= 100 items
object
from
required
Any of:
string
to
required
Any of:
string
cc
Any of:
string
bcc
Any of:
string
reply_to
Any of:
string
subject
required
string
>= 1 characters
html
string
text
string
headers
object
key
additional properties
string
attachments
Array<object>
object
filename
string
>= 1 characters
content
Any of:
string
path

A public https URL Duta downloads. Not accepted in a batch

string
content_type

Inferred from the filename when left out

string
content_id

For inline images referenced as cid: in the HTML

string
tags
Any of:
object
key
additional properties
string
/^[A-Za-z0-9_-]{1,256}$/

Success

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

Sent is a sandbox send, delivered at once

string
Allowed values: queued sent suppressed
errors
Array<object>
object
index
required
integer
message
required
string
code
required
string
name
required
string
Example
{
"data": [
{
"status": "queued"
}
]
}

Missing or invalid API key

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}

The request was refused. code says why

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}

Rate limited. Retry after the Retry-After header

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}