Send up to 100 emails
const url = 'https://api.duta.indra.sh/v1/emails/batch';const options = { method: 'POST', headers: { 'x-batch-validation': 'strict', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '[{"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"}}]'};
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.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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”Repeat a request safely for 24 hours. A replay carries Idempotent-Replayed: true
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
object
Responses
Section titled “ Responses ”Success
object
object
Sent is a sandbox send, delivered at once
object
Example
{ "data": [ { "status": "queued" } ]}Missing or invalid API key
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}The request was refused. code says why
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}Rate limited. Retry after the Retry-After header
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}