Emails
Scope emails:send. Transactional only; for marketing, use campaigns in the app.
Send an email
Section titled “Send an email”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' },)email = 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"}], idempotency_key="order-58213-receipt",)curl https://api.mailpidge.com/api/v1/emails \ -H "Authorization: Bearer $MAILPIDGE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-58213-receipt" \ -d '{ "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" }] }'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.
Send a batch
Section titled “Send a batch”POST /api/v1/emails/batch
Up to 100 emails with the fields above, except attachments and scheduledAt.
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 an email
Section titled “Get an email”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.
List emails
Section titled “List emails”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.
Reschedule an email
Section titled “Reschedule an email”PATCH /api/v1/emails/{id} with { "scheduledAt": "2026-11-28T09:00:00Z" }. Only for emails that haven’t been sent.
Cancel an email
Section titled “Cancel an email”POST /api/v1/emails/{id}/cancel. Only for scheduled emails that haven’t been sent. Returns the email with lastEvent: "canceled".