Skip to content

Email Logs API

Email logs record every email that Synapse queues, sends, delivers, or fails to deliver. Each log entry tracks the full lifecycle of an email -- from initial queue through delivery, opens, clicks, and bounces. Use this API to search and inspect email delivery history for your workspace.

Note

For a user guide on viewing email logs in the dashboard, see Email Logs.


Endpoints

MethodPathDescription
GET/v1/email-logsList email logs with filtering and pagination
GET/v1/email-logs/statsGet status breakdown counts
GET/v1/email-logs/{log_id}Get full detail for a single email log
POST/v1/email-logs/{log_id}/resendRe-send a bounced, failed, or suppressed email

List Email Logs

bash
curl "https://synapse-api.pyrx.tech/v1/email-logs?status=delivered&page=1&per_page=25" \
-H "Authorization: Bearer <jwt>"

Auth: JWT (dashboard). Requires logs:read permission.

Query Parameters

ParameterTypeDefaultDescription
searchstringSearch by recipient email, name, or subject (substring match)
statusstringFilter by status: queued, sent, delivered, opened, clicked, bounced, complained, failed, suppressed
date_fromdatetimeFilter from this datetime (ISO 8601)
date_todatetimeFilter until this datetime (ISO 8601)
template_idUUIDFilter by template ID
flow_idUUIDFilter by flow ID
pageinteger1Page number (1-indexed)
per_pageinteger25Items per page (1--100)

Response

json
{
"data": [
{
"id": "c3a1f8e2-7b4d-4e9a-b5c6-2d8f1a3e4b7c",
"contact_id": "8f14e45f-ceea-467f-a83c-01a01ba3c5db",
"recipient_email": "[email protected]",
"recipient_name": "Nguyen Van",
"subject": "Your claim has been submitted",
"status": "delivered",
"email_provider": "resend",
"template_name": "Claim Submitted Notification",
"flow_name": "Claim Submitted Flow",
"queued_at": "2026-04-20T09:15:00Z",
"sent_at": "2026-04-20T09:15:02Z",
"delivered_at": "2026-04-20T09:15:04Z",
"first_opened_at": "2026-04-20T10:30:00Z",
"first_clicked_at": null,
"bounced_at": null,
"error_message": null
}
],
"meta": {
"total": 1542,
"page": 1,
"per_page": 25,
"total_pages": 62
}
}
Note

The list endpoint excludes rendered_html for performance. Use the detail endpoint to retrieve the full rendered email body.


Get Email Log Stats

Returns a status breakdown of email log counts. Used for summary cards at the top of the email logs page.

bash
curl "https://synapse-api.pyrx.tech/v1/email-logs/stats?date_from=2026-04-01T00:00:00Z&date_to=2026-04-30T23:59:59Z" \
-H "Authorization: Bearer <jwt>"

Auth: JWT (dashboard). Requires logs:read permission.

Query Parameters

ParameterTypeDefaultDescription
date_fromdatetimeFilter from this datetime (ISO 8601)
date_todatetimeFilter until this datetime (ISO 8601)

Response

json
{
"total": 4820,
"queued": 12,
"sent": 45,
"delivered": 3980,
"opened": 1254,
"clicked": 387,
"bounced": 23,
"complained": 4,
"failed": 8,
"suppressed": 15
}

Get Email Log Detail

Returns the full detail for a single email log, including the rendered HTML body, linked contact info, template name, and flow name.

bash
curl "https://synapse-api.pyrx.tech/v1/email-logs/c3a1f8e2-7b4d-4e9a-b5c6-2d8f1a3e4b7c" \
-H "Authorization: Bearer <jwt>"

Auth: JWT (dashboard). Requires logs:read permission.

Response

json
{
"id": "c3a1f8e2-7b4d-4e9a-b5c6-2d8f1a3e4b7c",
"contact_id": "8f14e45f-ceea-467f-a83c-01a01ba3c5db",
"template_id": "d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123",
"flow_trip_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"recipient_email": "[email protected]",
"recipient_name": "Nguyen Van",
"subject": "Your claim has been submitted",
"rendered_html": "<html><body><h1>Hi Nguyen Van</h1><p>Your claim #CLM-2891 has been submitted...</p></body></html>",
"status": "delivered",
"email_provider": "resend",
"provider_message_id": "re_abc123def456",
"template_name": "Claim Submitted Notification",
"flow_name": "Claim Submitted Flow",
"contact_email": "[email protected]",
"contact_name": "Nguyen Van",
"queued_at": "2026-04-20T09:15:00Z",
"sent_at": "2026-04-20T09:15:02Z",
"delivered_at": "2026-04-20T09:15:04Z",
"first_opened_at": "2026-04-20T10:30:00Z",
"first_clicked_at": null,
"bounced_at": null,
"error_message": null
}

Error Response (404)

json
{
"detail": "Email log not found"
}

Resend an Email

Re-sends a previously failed delivery using the original rendered content (recipient, subject, and HTML body). A new email log entry is created for the attempt; the original log is never modified.

bash
curl -X POST "https://synapse-api.pyrx.tech/v1/email-logs/c3a1f8e2-7b4d-4e9a-b5c6-2d8f1a3e4b7c/resend" \
-H "Authorization: Bearer <jwt>"

Auth: JWT (dashboard). Requires logs:read permission.

Only emails with a status of bounced, failed, or suppressed can be resent. Any other status returns 400.

Response

json
{
"success": true,
"new_log_id": "e7d9a2b1-4c3f-4a8e-9b2d-1f6c8a3e5d90"
}
FieldTypeDescription
successbooleantrue if the resend was handed off to the email provider. false if it failed or was suppressed.
new_log_idUUIDThe email log created for the resend attempt.
Note

Resending a commercial email re-attaches the CAN-SPAM footer and one-click unsubscribe headers. The footer is applied at send time, so it is re-derived on every resend rather than copied from the original message.

Warning

If the original was a commercial email and your workspace has no complete company address, the resend is suppressed: success is false, new_log_id points at a suppressed log, and no email is sent. Complete your company information in Settings → General first. See Email Delivery.

Error Responses

StatusWhen
400Status is not bounced, failed, or suppressed, or the original is missing rendered content (recipient, subject, or HTML body).
404Email log not found.

Email Log Statuses

StatusDescription
queuedEmail has been queued for sending
sentEmail was handed off to the email provider
deliveredProvider confirmed delivery to the recipient's mail server
openedRecipient opened the email (tracked via pixel)
clickedRecipient clicked a link in the email
bouncedEmail bounced (hard bounce -- invalid address, domain does not exist)
complainedRecipient marked the email as spam. Contact is auto-unsubscribed.
failedEmail failed to send (Resend-side error, rendering error, etc.)
suppressedEmail was deliberately not sent. Causes include an NLT required modifier resolving to null, the provider suppression list, or a commercial send blocked by a missing company address (error_message = suppressed:missing_company_address).