Skip to content

Email Events

Email delivery events are status notifications generated at each stage of the email delivery pipeline — from initial queue acceptance through final delivery, bounce, or failure. Tracking these events gives senders real-time visibility into whether each email reached the recipient’s inbox, bounced, or was marked as spam.

Every email sent through RelayPost generates a trail of events as it moves through the delivery pipeline. You can query these events via the API or receive them in real time via webhooks.

GET /api/v1/emails/:id

The response includes the full event timeline for the email.

Terminal window
curl "https://api.relaypost.dev/v1/emails/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"from_address": "hello@yourdomain.com",
"to_addresses": ["user@example.com"],
"subject": "Your receipt",
"status": "delivered",
"events": [
{
"id": "evt_001",
"type": "delivered",
"recipient": "user@example.com",
"smtp_code": 250,
"smtp_message": "OK",
"created_at": "2025-01-15T10:30:05.000Z"
}
]
}
}
TypeDescription
queuedEmail accepted into the delivery queue
processingDelivery attempt in progress
deliveredSuccessfully accepted by the recipient’s mail server
openedRecipient opened the email (pixel tracking)
bouncedRecipient’s server permanently rejected the email
deferredTemporary failure — will retry automatically
failedAll retry attempts exhausted
complainedRecipient reported the email as spam
rejectedEmail rejected before sending (validation, suppression)
FieldTypeDescription
typeStringEvent type (see above)
recipientStringThe recipient email address
mx_hostStringThe MX server that handled the email
smtp_codeIntSMTP response code (e.g., 250, 550)
smtp_messageStringSMTP response message from the receiving server
created_atDateTimeWhen the event occurred
CodeMeaning
250Success — email accepted
421Service temporarily unavailable — will retry
450Mailbox temporarily unavailable — will retry
550Mailbox not found — hard bounce
551User not local — forwarding error
552Mailbox full
553Invalid mailbox name
554Transaction failed — often a policy rejection

You can also view events in the RelayPost dashboard under Messages. Click any email to see its full event timeline.

RelayPost tracks these events: queued, processing, delivered, opened, bounced, deferred, failed, complained, and rejected. Each event includes the recipient, timestamp, SMTP code, and server response.

Set up a webhook endpoint to receive HTTP POST notifications as events occur. Alternatively, query the API to get the full event timeline for any email by its ID.

A deferred event means the recipient’s mail server returned a temporary failure (SMTP 4xx code). RelayPost automatically retries deferred emails with exponential backoff. If all retries fail, a “failed” event is generated.