Send an email, a batch, or one for later
POST /v1/emails takes one email and answers with its id; everything after it is on the email's page.
POST /v1/emails takes one email and answers with its id; everything after it is on the email's page.
const email = await minket.emails.send({
from: "receipts@mail.fernbank.example",
to: "rui.okafor@example.com",
subject: "Your receipt for order 10452",
html: "<p>Thanks, Rui. Your receipt is attached.</p>",
attachments: [
{ id: "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b" },
],
tags: [{ name: "order", value: "10452" }],
});curl https://api.minket.com/v1/emails \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: receipt-10452" \
-d '{
"from": "receipts@mail.fernbank.example",
"to": "rui.okafor@example.com",
"subject": "Your receipt for order 10452",
"text": "Thanks, Rui. Your receipt is attached.",
"attachments": [
{ "id": "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b" }
],
"tags": [{ "name": "order", "value": "10452" }]
}'In the console
An idempotency key holds for 24 hours, and the TypeScript SDK puts one on every send that has none.
idempotent_replay: true422 invalid_idempotent_request409 concurrent_idempotent_requestsPOST /v1/emails/batch checks every item on its own, so one bad address costs one email.
{
"object": "batch",
"data": [
{
"index": 0,
"id": "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5d",
"status": "queued"
},
{
"index": 1,
"error": { "code": "validation_error", "retryable": false }
}
],
"accepted": 1,
"rejected": 1
}Set scheduled_at to a time or to words read in UTC, then move or cancel it until it goes.
{ "scheduled_at": "tomorrow at 9am" }Up to 20 on one email, within 40 MB for the whole message.
| Form | Up to | How |
|---|---|---|
| Inline | 4 MB | content in the request |
| By reference | 25 MB | an id from POST /v1/attachments, reused |
| By URL | 25 MB | path, fetched over https as it sends |
When a send's outcome is unclear, the email is marked failed with outcome_unknown instead of going out again.
A minket_test_ key accepts, renders and stores mail and plays its events, 2 seconds apart.
Sandbox
Test mode| Recipient | Events played |
|---|---|
| delivered@minket.test | email.sent, email.delivered |
| bounced@minket.test | email.sent, email.bounced |
| complained@minket.test | email.sent, email.delivered, email.complained |
| delayed@minket.test | email.sent, email.delivery_delayed, email.delivered |
Hosted and versioned, the last 50 versions kept.
Transactional and marketing mail apart; marketing carries an unsubscribe link.
Credentials for software that only speaks SMTP.
Live sending stops when bounces or complaints climb, until you resume it; waiting mail stays put.
The email is accepted and reported with email.suppressed, and the other recipients still get it.
One recipient per marketing email, so each unsubscribe link belongs to one person.
Up to 50 across to, cc and bcc.