Skip to content
PreviewNot live yet. APIs and SDKs on these pages may change before launch.

Emails

Scope emails:send. Transactional only; for marketing, use campaigns in the app.

POST /api/v1/emails

Field Type Notes
from string Required. Name <address> on a verified domain
to string[] Required. 1 to 50 addresses
subject string Required
html string html or text is required
text string Plain-text part; generated from html when missing
cc, bcc string[] Count toward the 50
replyTo string[]
attachments object[] filename, content (base64), contentType, optional contentId for inline images. 40 MB per email in total.
tags object[] name and value; returned in webhooks and metrics
headers object Extra headers, such as X-Entity-Ref-ID
scheduledAt string ISO 8601, up to 30 days ahead

Add an Idempotency-Key header so retries never send twice.

const email = await mailpidge.emails.send(
{
from: 'Pidge Fit <receipts@pidgefit.com>',
to: ['jamie@example.com'],
subject: 'Your receipt',
html: '<p>Thanks for your order.</p>',
tags: [{ name: 'category', value: 'receipt' }],
},
{ idempotencyKey: 'order-58213-receipt' },
)

Response 200

{ "id": "em_01JD4V8QK3S6T2Y9Z7XWB5N0RA", "suppressed": [] }

suppressed: recipients skipped as suppressed.

Errors: invalid_request, domain_not_allowed, recipient_suppressed, monthly_limit_reached, idempotency_key_reused, rate_limited.

POST /api/v1/emails/batch

Up to 100 emails with the fields above, except attachments and scheduledAt.

Terminal window
curl https://api.mailpidge.com/api/v1/emails/batch \
-H "Authorization: Bearer $MAILPIDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{ "from": "Pidge Fit <hello@pidgefit.com>", "to": ["a@example.com"], "subject": "Hi A", "html": "<p>Hi</p>" },
{ "from": "Pidge Fit <hello@pidgefit.com>", "to": ["b@example.com"], "subject": "Hi B", "html": "<p>Hi</p>" }
]'

Response 200

{ "emails": [{ "id": "em_01JD4V…RA" }, { "id": "em_01JD4V…RB" }] }

GET /api/v1/emails/{id}

{
"id": "em_01JD4V8QK3S6T2Y9Z7XWB5N0RA",
"from": "Pidge Fit <receipts@pidgefit.com>",
"to": ["jamie@example.com"],
"subject": "Your receipt",
"createdAt": "2026-11-25T09:14:01.002Z",
"scheduledAt": null,
"lastEvent": "delivered",
"tags": [{ "name": "category", "value": "receipt" }]
}

lastEvent is one of queued, scheduled, sent, delivered, delivery_delayed, bounced, complained, failed, suppressed, canceled, opened, clicked.

GET /api/v1/emails?limit=50&cursor={nextCursor}

limit is 1 to 100 (default 50). Newest first.

{ "emails": [{ "id": "em_…", "subject": "Your receipt", "lastEvent": "delivered", "createdAt": "…" }], "nextCursor": "c_8Jd…" }

Pass nextCursor as cursor to get the next page; it is null on the last page.

PATCH /api/v1/emails/{id} with { "scheduledAt": "2026-11-28T09:00:00Z" }. Only for emails that haven’t been sent.

POST /api/v1/emails/{id}/cancel. Only for scheduled emails that haven’t been sent. Returns the email with lastEvent: "canceled".