Skip to content

Send an email

Send a transactional email.

POST https://api.duta.indra.sh/v1/email/send

Pass your API key as a bearer token:

Authorization: Bearer duta_live_xxx
FieldTypeRequiredDescription
fromstringyesSender address. Its domain must be verified.
tostring or string[]yesOne recipient, or up to many.
subjectstringyesSubject line.
htmlstringone ofHTML body.
textstringone ofPlain-text body.
replyTostringnoReply-To address.
tagsRecord<string, string>noArbitrary key/value metadata.

At least one of html or text is required.

Terminal window
curl -X POST https://api.duta.indra.sh/v1/email/send \
-H "Authorization: Bearer duta_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"from": "hello@yourdomain.com",
"to": ["a@example.com", "b@example.com"],
"subject": "Your receipt",
"html": "<p>Thanks for your order.</p>",
"tags": { "order_id": "1234" }
}'
await duta.emails.send({
from: "hello@yourdomain.com",
to: ["a@example.com", "b@example.com"],
subject: "Your receipt",
html: "<p>Thanks for your order.</p>",
tags: { order_id: "1234" },
});

202 Accepted

{ "id": "3f6c1a2b-...", "status": "queued" }

Use the id to retrieve the email later. Errors are documented under Errors.