Skip to content
Docs menu

Emails

Every Emails endpoint.

GET/v1/analytics

Aggregate delivery, engagement and per-tag analytics

Delivery and engagement totals over the trailing `days` (default 7), plus a daily `time_series` and a `by_tag` breakdown keyed on `EmailSend.tag`.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
daysqueryoptional

Responses

200 : Default Response

FieldTypeRequiredDescription
by_tagarrayrequired
by_tag[].bouncednumberrequired
by_tag[].clickednumberrequired
by_tag[].openednumberrequired
by_tag[].sentnumberrequired
by_tag[].tagstringrequired
event_totals.bouncednumberoptional
event_totals.clickednumberoptional
event_totals.delayednumberoptional
event_totals.failednumberoptional
event_totals.heldnumberoptional
event_totals.openednumberoptional
event_totals.sentnumberoptional
summary.bounce_ratenumberrequired
summary.click_ratenumberrequired
summary.delivery_ratenumberrequired
summary.open_ratenumberrequired
summary.total_bouncednumberrequired
summary.total_clickednumberrequired
summary.total_deliverednumberrequired
summary.total_openednumberrequired
summary.total_sentnumberrequired
time_seriesarrayrequired
time_series[].bouncednumberoptional
time_series[].clickednumberoptional
time_series[].datestringrequired
time_series[].delayednumberoptional
time_series[].deliverednumberoptional
time_series[].failednumberoptional
time_series[].heldnumberoptional
time_series[].openednumberoptional
time_series[].sentnumberoptional
curl
curl https://api.zsender.io/v1/analytics \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails

List sent emails

Messages this tenant sent, newest first. `search` is case-insensitive and matches a WHOLE recipient address, or a substring of the sender or the subject; `tag` is an exact match on the tag set at send time.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
pagequeryoptional
limitqueryoptional
searchqueryoptional
tagqueryoptional

Responses

200 : Default Response

FieldTypeRequiredDescription
dataarrayrequired
data[].created_atstringrequired · nullable
data[].event_countnumberrequired
data[].fromstringrequired
data[].idstringrequired
data[].last_eventstringrequired · nullable
data[].message_idstringrequired
data[].modestringrequired
data[].subjectstringrequired · nullable
data[].tagstringrequired · nullable
data[].toarrayrequired
data[].to[]stringoptional
pagination.limitnumberrequired
pagination.pagenumberrequired
pagination.pagesnumberrequired
pagination.totalnumberrequired
curl
curl https://api.zsender.io/v1/emails \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/{id}

Get one sent email

The stored record for one message this tenant sent, by its `id` from the send response. `404` if the id is unknown or belongs to another tenant.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
idpathrequired

Responses

200 : Default Response

FieldTypeRequiredDescription
created_atstringrequired · nullable
eventsarrayrequired
events[].event_typestringrequired
events[].idstringrequired
events[].timestampstringrequired · nullable
fromstringrequired
idstringrequired
last_eventstringrequired · nullable
message_idstringrequired
subjectstringrequired · nullable
toarrayrequired
to[]stringoptional
curl
curl https://api.zsender.io/v1/emails/{id} \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/{id}/events

Delivery events and SMTP attempts

`attempts[]` is the per-recipient SMTP transcript (`status`, `smtp_output`, `details`, `sent_with_ssl`, `duration_ms`, `at`) parsed from the mail server's stored delivery events, plus `spam_status`. No new call to the mail server is made.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
idpathrequired

Responses

200 : Default Response

FieldTypeRequiredDescription
attemptsarrayrequired
attempts[].atstringrequired
attempts[].detailsstringrequired · nullable
attempts[].duration_msnumberrequired · nullable
attempts[].sent_with_sslbooleanrequired
attempts[].smtp_outputstringrequired · nullable
attempts[].statusstringrequired · nullable
eventsarrayrequired
events[].event_typestringrequired
events[].idstringrequired
events[].timestampstringrequired · nullable
spam_statusstringrequired · nullable
curl
curl https://api.zsender.io/v1/emails/{id}/events \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/{id}/inspect

Inspect raw MIME, headers and spam result

Live-fetches raw MIME, headers, inspection and spam score straight from the mail server for one `recipient` of the message. `409` when no stored message id exists for that recipient yet.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
recipientqueryoptional
idpathrequired

Responses

200 : Default Response

FieldTypeRequiredDescription
headersobjectrequired
inspectionobjectrequired
raw_messagestringrequired · nullable
recipientstringrequired
spam_checksobjectrequired
spam_statusstringrequired · nullable
curl
curl https://api.zsender.io/v1/emails/{id}/inspect \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/received

List received mail

Metadata only, no text/html/attachment bytes. `to`/`from` are exact/contains filters; `since`/`until` filter on receipt time and accept either a date (`YYYY-MM-DD`, interpreted as midnight UTC) or a full RFC 3339 timestamp with an offset (e.g. `2026-01-01T00:00:00Z`).

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
pagequeryoptional
limitqueryoptional
toqueryoptional
fromqueryoptional
sincequeryoptional
untilqueryoptional

Responses

200 : Default Response

FieldTypeRequiredDescription
dataarrayrequired
data[].attachment_countnumberrequired
data[].bccarrayrequired
data[].bcc[]stringoptional
data[].bouncebooleanrequired
data[].ccarrayrequired
data[].cc[]stringoptional
data[].datestringrequired · nullable
data[].fromstringrequired
data[].from_addressstringrequired
data[].idstringrequired
data[].in_reply_tostringrequired · nullable
data[].message_idstringrequired
data[].received_atstringrequired · nullable
data[].received_forarrayrequired
data[].received_for[]stringoptional
data[].referencesarrayrequired
data[].references[]stringoptional
data[].sizenumberrequired
data[].spam_statusstringrequired
data[].subjectstringrequired
data[].toarrayrequired
data[].to[]stringoptional
pagination.limitnumberrequired
pagination.pagenumberrequired
pagination.pagesnumberrequired
pagination.totalnumberrequired
curl
curl https://api.zsender.io/v1/emails/received \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/received/{id}

Get one received message

Includes `text`/`html` body and attachment metadata (`filename`, content type, size, not the bytes; fetch those from the attachment endpoint). `404` for an unknown or cross-tenant id.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
idpathrequired

Responses

200 : Default Response

FieldTypeRequiredDescription
attachmentsarrayrequired
attachments[].content_typestringrequired
attachments[].filenamestringrequired
attachments[].idstringrequired
attachments[].sizenumberrequired
auto_submittedstringrequired · nullable
bccarrayrequired
bcc[]stringoptional
bouncebooleanrequired
ccarrayrequired
cc[]stringoptional
datestringrequired · nullable
fromstringrequired
from_addressstringrequired
htmlstringrequired · nullable
idstringrequired
in_reply_tostringrequired · nullable
message_idstringrequired
received_atstringrequired · nullable
received_forarrayrequired
received_for[]stringoptional
referencesarrayrequired
references[]stringoptional
sizenumberrequired
spam_statusstringrequired
subjectstringrequired
textstringrequired · nullable
toarrayrequired
to[]stringoptional
curl
curl https://api.zsender.io/v1/emails/received/{id} \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/received/{id}/attachments/{attachmentId}

Download an attachment

Binary. The response `Content-Type` is the attachment's own MIME type.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
idpathrequired
attachmentIdpathrequired

Responses

200 : Default Response

curl
curl https://api.zsender.io/v1/emails/received/{id}/attachments/{attachmentId} \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
GET/v1/emails/received/{id}/raw

Fetch the raw MIME message

message/rfc822. The mail server's stored copy, not the sender's original bytes: the mail server prepends four X-Postal-* headers on receipt.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
idpathrequired

Responses

200 : Default Response

curl
curl https://api.zsender.io/v1/emails/received/{id}/raw \
  -H "Authorization: Bearer $ZSENDER_API_KEY"
POST/v1/emails/send

Send an email

`to` accepts up to 50 recipients. `from` accepts a bare address (`hello@yourverifieddomain.com`) or a display name followed by one in angle brackets (`Acme <hello@yourverifieddomain.com>`), on a domain whose sending capability is VERIFIED and enabled. Pass an `Idempotency-Key` header to make the call safe to retry.

Auth: apiKey or jwt

Parameters

NameInRequiredDescription
idempotency-keyheaderoptional

Request body

FieldTypeRequiredDescription
attachmentsarrayoptional
attachments[].content_typestringrequired
attachments[].datastringrequired
attachments[].namestringrequired
bccarrayoptional
bcc[]stringoptional
ccarrayoptional
cc[]stringoptional
fromstringrequired
headersobjectoptional
htmlstringoptional
in_reply_tostringoptional
references(1)arrayoptional
references(1)[]stringoptional
references(2)stringoptional
reply_tostringoptional
subjectstringrequired
tagstringoptional
textstringoptional
toarrayrequired
to[]stringoptional
transactionalbooleanoptional
Example request body
{
  "from": "receipts@yourverifieddomain.com",
  "html": "<p>Hi Jane, thanks for your payment, your receipt for September is attached below.</p>",
  "subject": "Your zSender receipt for September",
  "tag": "receipt-monthly",
  "to": [
    "jane.doe@example.com"
  ],
  "transactional": true
}

Responses

200 : Default Response

FieldTypeRequiredDescription
message_idstringrequired · nullable
messagesobjectrequired
suppressedarrayrequired
suppressed[].emailstringrequired
suppressed[].reasonstringrequired
curl
curl https://api.zsender.io/v1/emails/send \
  -X POST \
  -H "Authorization: Bearer $ZSENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "receipts@yourverifieddomain.com",
  "html": "<p>Hi Jane, thanks for your payment, your receipt for September is attached below.</p>",
  "subject": "Your zSender receipt for September",
  "tag": "receipt-monthly",
  "to": [
    "jane.doe@example.com"
  ],
  "transactional": true
}'