LettermintLettermint
  • Knowledge base
  • Community
  • Changelog
  • Support
  • Documentation
  • Sending API
  • Team API
Getting started
Guides
Platform
    Projects & Routes
    Emails
    Inbound Mail
    Domains
    Webhooks
      IntroductionWebhook eventsSigned webhooks
    Teams
    Onboarding
Resources
Webhooks

Webhook events

Learn what events Lettermint can send and how to handle them. Subscribe to the events you need when creating a webhook.

Common envelope

All webhook events share a consistent envelope:

Code
{ "id": "54d7e8c9-1195-4ba0-9d3f-b9af92305add", "event": "message.delivered", "timestamp": "2025-08-08T20:14:00.000Z", "data": { /* event-specific object */ } }

Fields:

  • id: Unique identifier (UUIDv4) for the specific delivery event. Useful for idempotency.
  • event: Event type.
  • timestamp: ISO timestamp when the event occurred.
  • data: Event-specific fields (documented per event below).

Common message data fields:

  • message_id: The unique identifier for the message.
  • subject: The email subject line.
  • metadata: Custom metadata attached to the message (if any).
  • tag: The tag assigned to categorize the message (e.g., "newsletter", "order-confirmation"). Will be null if no tag was assigned.

These fields apply to message.* events. Suppression events use the suppression-specific fields documented below.

Event payloads

message.created

Message accepted for processing.

Example payload:

Code
{ "id": "54d7e8c9-1195-4ba0-9d3f-b9af92305add", "event": "message.created", "timestamp": "2025-08-08T20:14:00.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "from": { "email": "updates@acme.com", "name": "Acme Updates" }, "to": ["user@example.com"], "cc": ["cc@example.com"], "bcc": ["bcc@example.com"], "reply_to": ["help@acme.com"], "subject": "Welcome to Acme", "metadata": { "X-Campaign-ID": "welcome-2025" }, "tag": "welcome" } }

message.sent

Message sent to recipient server.

Code
{ "id": "7f9c8e2a-1b3d-4f6e-b7d2-5c9f3a7e8b0c", "event": "message.sent", "timestamp": "2025-08-08T20:15:00.000Z", "data": { "message_id": "123e4567-e89b-12d3-a456-426614174000", "subject": "Your weekly newsletter", "recipient": "user@example.com", "metadata": { "X-User-ID": "user-123" }, "tag": "newsletter" } }

message.delivered

Message successfully delivered.

Code
{ "id": "9b0c4a4e-4e29-4d8b-8b3a-3f0f3e6d2f9b", "event": "message.delivered", "timestamp": "2025-08-08T20:15:12.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Your order has shipped", "recipient": "user@example.com", "response": { "status_code": 250, "enhanced_status_code": "2.0.0", "content": "OK 1640705112 qp1355551phe.1 - gsmtp" }, "metadata": { "X-Transaction-ID": "txn-456" }, "tag": "order-confirmation" } }

message.auto_replied

Recipient mail server sent an automatic reply such as an out-of-office or vacation response. Auto replies are informational and do not change the message delivery status.

Code
{ "id": "4c1a6e5b-7a2f-4f8a-9d3e-6f7b8c9d0e1f", "event": "message.auto_replied", "timestamp": "2025-08-08T20:16:10.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Your order has shipped", "metadata": { "X-Order-ID": "order-12345" }, "tag": "shipping", "auto_reply": { "sender": "user@example.com", "recipient": "feedback-f47ac10b-58cc-4372-a567-0e02b2c3d479@lm-bounces.example.com", "subject": "Automatic reply: out of office", "body": { "text": "I am currently out of office and will reply when I return.", "html": "<p>I am currently out of office and will reply when I return.</p>" } } } }

Fields:

  • auto_reply.sender: Address that sent the automatic reply, when available
  • auto_reply.recipient: Bounce/feedback recipient address that received the automatic reply
  • auto_reply.subject: Subject of the automatic reply, when available
  • auto_reply.body.text: Plain-text automatic reply body, when available
  • auto_reply.body.html: HTML automatic reply body, when available

message.hard_bounced

Permanent delivery failure (e.g., user does not exist).

Code
{ "id": "123e4567-e89b-12d3-a456-426614174000", "event": "message.hard_bounced", "timestamp": "2025-08-08T20:15:30.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Summer sale - 50% off!", "recipient": "user@example.com", "response": { "status_code": 250, "enhanced_status_code": "2.0.0", "content": "OK 1640705112 qp1355551phe.1 - gsmtp" }, "metadata": { "X-Campaign-ID": "summer-sale" }, "tag": "marketing" } }

message.soft_bounced

Temporary delivery failure (e.g., mailbox full, transient error).

Code
{ "id": "9b0c4a4e-4e29-4d8b-8b3a-3f0f3e6d2f9b", "event": "message.soft_bounced", "timestamp": "2025-08-08T20:15:30.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Your order #789 update", "recipient": "user@example.com", "response": { "status_code": 250, "enhanced_status_code": "2.0.0", "content": "OK 1640705112 qp1355551phe.1 - gsmtp" }, "metadata": { "X-Order-ID": "order-789" }, "tag": "order-notification" } }

message.spam_complaint

Recipient reported the message as spam.

Code
{ "id": "123e4567-e89b-12d3-a456-426614174000", "event": "message.spam_complaint", "timestamp": "2025-08-08T20:16:00.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Weekly digest - August edition", "recipient": "user@example.com", "metadata": { "X-Newsletter-ID": "weekly-digest" }, "tag": "newsletter" } }

message.failed

The message could not be delivered due to a terminal processing or delivery failure.

Code
{ "id": "9b0c4a4e-4e29-4d8b-8b3a-3f0f3e6d2f9b", "event": "message.failed", "timestamp": "2025-08-08T20:14:12.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Password reset request", "recipient": "user@example.com", "reason": "5.7.10 Encryption needed: recipient did not offer STARTTLS", "reason_code": "enforced_tls_failed", "response": { "status_code": 550 }, "metadata": { "X-Session-ID": "sess-abc123" }, "tag": null } }

When an enforced TLS policy cannot be satisfied, reason_code is enforced_tls_failed and response.status_code is 550. Temporary connection and TLS errors continue through normal retries and are reported as message.soft_bounced while retryable.

message.suppressed

Message was suppressed due to previous bounce or complaint.

Code
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "event": "message.suppressed", "timestamp": "2025-08-08T20:14:05.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Your account statement", "recipient": "user@example.com", "reason": "hard_bounce", "metadata": { "X-Account-ID": "acc-xyz789" }, "tag": "transactional" } }

message.policy_rejected

Message rejected by policy (spam or content filter). This occurs when a message's spam score exceeds the configured threshold before delivery.

Code
{ "id": "c4d5e6f7-a8b9-0123-cdef-456789abcdef", "event": "message.policy_rejected", "timestamp": "2025-08-08T20:14:03.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Limited time offer!!!", "reason": "Spam score threshold exceeded", "score": 7.5, "spam_symbols": [ { "name": "BAYES_SPAM", "score": 3.5, "options": [], "description": "Bayes spam probability is very high" }, { "name": "SUBJ_ALL_CAPS", "score": 1.5, "options": [], "description": "Subject is all capitals" } ], "metadata": { "X-Campaign-ID": "promo-123" }, "tag": "marketing" } }

Fields:

  • reason: Human-readable rejection reason (e.g., "spam content", "policy violation")
  • score: The spam score that triggered the rejection
  • spam_symbols: Array of spam rule matches with name, score, options, and description

message.unsubscribed

Recipient unsubscribed from the mailing list.

Code
{ "id": "b2c3d4e5-f6a7-8901-bcde-f01234567891", "event": "message.unsubscribed", "timestamp": "2025-08-08T20:16:30.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "August newsletter highlights", "recipient": "user@example.com", "unsubscribed_at": "2025-08-08T20:16:30.000Z", "metadata": { "X-Campaign-ID": "newsletter-august" }, "tag": "newsletter" } }

message.opened

Recipient opened the email. Requires open tracking to be enabled on the route.

This event is only available for routes with open tracking enabled. By default, webhooks receive only human-countable opens; machine, privacy proxy, and security scanner opens require Include machine events.

Code
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "event": "message.opened", "timestamp": "2025-08-08T20:17:00.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Your order has shipped", "metadata": { "X-Order-ID": "order-12345" }, "tag": "shipping", "recipient": "user@example.com", "opened_at": "2025-08-08T20:17:00+00:00", "first_open": true, "device_type": "desktop", "client_type": "browser", "client_name": "Chrome", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36", "bot": { "detected": false, "probability": 0, "classification": "genuine", "proxy_type": null, "reason_codes": [], "machine": false, "counts_for_metrics": true } } }

Fields:

  • opened_at: Timestamp when the open was detected
  • first_open: Whether this is the first time this recipient opened the email
  • device_type: Device category: desktop, mobile, or tablet
  • client_type: Client category: browser, email_client, etc.
  • client_name: Specific client name: Chrome, Safari, Outlook, etc.
  • user_agent: The user agent string from the request
  • bot.detected: Whether the open appears to be from an automated source (bot, proxy, scanner)
  • bot.probability: Confidence score (0-100) that this is a bot interaction
  • bot.classification: Source classification such as genuine, privacy_proxy, security_scanner, or generic_bot
  • bot.proxy_type: Known proxy family when applicable, otherwise null
  • bot.reason_codes: Machine-readable reasons behind the classification
  • bot.machine: Whether this open was classified as machine, privacy, or security activity
  • bot.counts_for_metrics: Whether this open contributes to default engagement metrics

See Bot Detection Field Values for classification and proxy_type values, plus reason_codes guidance.

message.clicked

Recipient clicked a link in the email. Requires click tracking to be enabled on the route.

This event is only available for routes with click tracking enabled. By default, webhooks receive only human-countable clicks; machine, link preview, and security scanner clicks require Include machine events.

Code
{ "id": "b2c3d4e5-f6a7-8901-bcde-f01234567892", "event": "message.clicked", "timestamp": "2025-08-08T20:18:30.000Z", "data": { "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "subject": "Your weekly recommendations", "metadata": { "X-Campaign-ID": "weekly-recs" }, "tag": "recommendations", "recipient": "user@example.com", "clicked_at": "2025-08-08T20:18:30+00:00", "destination_url": "https://example.com/product/123", "link_index": 0, "anchor_text": "View Product", "first_click": true, "device_type": "mobile", "client_type": "browser", "client_name": "Safari", "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15", "bot": { "detected": false, "probability": 0, "classification": "genuine", "proxy_type": null, "reason_codes": [], "machine": false, "counts_for_metrics": true } } }

Fields:

  • clicked_at: Timestamp when the click occurred
  • destination_url: The original destination URL that was clicked
  • link_index: Zero-based index of the link in the email (order of appearance)
  • anchor_text: The visible text of the clicked link
  • first_click: Whether this is the first time this recipient clicked any link in this email
  • device_type: Device category: desktop, mobile, or tablet
  • client_type: Client category: browser, email_client, etc.
  • client_name: Specific client name: Chrome, Safari, Outlook, etc.
  • user_agent: The user agent string from the request
  • bot.detected: Whether the click appears to be from an automated source (security scanner, link preview bot)
  • bot.probability: Confidence score (0-100) that this is a bot interaction
  • bot.classification: Source classification such as genuine, privacy_proxy, security_scanner, or generic_bot
  • bot.proxy_type: Known proxy family when applicable, otherwise null
  • bot.reason_codes: Machine-readable reasons behind the classification
  • bot.machine: Whether this click was classified as machine, preview, or security activity
  • bot.counts_for_metrics: Whether this click contributes to default engagement metrics

See Bot Detection Field Values for classification and proxy_type values, plus reason_codes guidance.

Suppression events

Suppression events are emitted once per non-global suppression entry and are delivered to enabled, subscribed webhooks attached to transactional and broadcast routes affected by that entry.

Global-scope suppressions do not emit webhook events. Inbound routes do not support suppression events.

Delivery fans out according to the suppression scope:

Suppression scopeWebhook recipients
routeWebhooks attached to that route
projectWebhooks attached to routes in that project
teamWebhooks attached to routes in that team

Duplicate additions do not emit another event. A removal event is emitted only when the suppression is actually deleted, so a removal that remains pending for manual review does not emit suppression.removed.

suppression.added

A suppression entry affecting the webhook's route was added. The envelope timestamp is the suppression's creation time and matches data.created_at.

Code
{ "id": "6f9475b4-487e-4a6e-b79f-983fd7b02ed8", "event": "suppression.added", "timestamp": "2026-07-29T08:15:30.000Z", "data": { "suppression_id": "1d74d4c9-8492-4f5f-ae3f-f6fd671399ea", "type": "email", "value": "suppressed@example.com", "reason": "hard_bounce", "scope": "route", "project_id": "ed5167ac-4b45-4ae8-b4d7-a6d2a6447dfc", "route_id": "293042ec-0f28-4684-a9e9-37e5b74fcf3b", "source_message_id": "ae10f044-398e-4bb1-97fa-4dc1e87d1c6f", "created_at": "2026-07-29T08:15:30.000Z" } }

suppression.removed

A suppression entry affecting the webhook's route was deleted. The original suppression fields remain in the payload. The envelope timestamp is the committed removal time and matches data.removed_at.

Code
{ "id": "9a61ff8c-42fe-4e02-a01e-6cb742ab8d87", "event": "suppression.removed", "timestamp": "2026-07-29T09:45:00.000Z", "data": { "suppression_id": "1d74d4c9-8492-4f5f-ae3f-f6fd671399ea", "type": "email", "value": "suppressed@example.com", "reason": "hard_bounce", "scope": "route", "project_id": "ed5167ac-4b45-4ae8-b4d7-a6d2a6447dfc", "route_id": "293042ec-0f28-4684-a9e9-37e5b74fcf3b", "source_message_id": "ae10f044-398e-4bb1-97fa-4dc1e87d1c6f", "created_at": "2026-07-29T08:15:30.000Z", "removed_at": "2026-07-29T09:45:00.000Z" } }

Suppression event data fields:

  • suppression_id: Unique identifier for the suppression entry.
  • type: Suppressed value type: email, domain, or extension.
  • value: The suppressed email address, domain, or extension.
  • reason: Why the entry was created: manual, hard_bounce, spam_complaint, or unsubscribe.
  • scope: Suppression scope: team, project, or route.
  • project_id: Project containing the suppression. null for team-scoped suppressions.
  • route_id: Route containing the suppression. null for team- and project-scoped suppressions.
  • source_message_id: Message that caused the suppression, when available; otherwise null.
  • created_at: Original suppression creation time.
  • removed_at: Committed removal time. Present only on suppression.removed.

Inbound events

message.inbound

Sent when an inbound route receives and parses an email. The event contains SMTP envelope data, parsed message headers and bodies, attachment references, spam diagnostics, and the original raw message.

This event is only available for webhooks attached to inbound routes. See Inbound Mail to create a route, or Process inbound email for handling guidance.

Example payload:

Code
{ "id": "e3d4f5a6-b7c8-9012-d3e4-f5a6b7c89012", "event": "message.inbound", "timestamp": "2025-10-02T14:30:00.000Z", "data": { "route": "support-inbox", "message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "envelope": { "remote_ip": "203.0.113.42", "remote_hostname": "mail.example.com", "helo": "smtp.example.com", "mail_from": "customer@example.com" }, "from": { "email": "customer@example.com", "name": "John Doe", "subaddress": null }, "to": [ { "email": "support@acme.com", "name": null, "subaddress": null } ], "cc": [], "recipient": "support@acme.com", "subaddress": null, "reply_to": "customer@example.com", "subject": "Question about my order", "date": "2025-10-02T14:30:00.000Z", "body": { "text": "Hi, I have a question about my recent order...", "html": "<p>Hi, I have a question about my recent order...</p>" }, "tag": null, "headers": [ { "name": "Message-ID", "value": "<abc123@mail.example.com>" }, { "name": "X-Mailer", "value": "Apple Mail (2.3445.104.11)" } ], "authentication_results": { "authserv_id": "inbound.lettermint.co", "header": "inbound.lettermint.co; dkim=pass header.d=example.com header.s=mail; dmarc=pass header.from=example.com policy=none; spf=pass smtp.mailfrom=example.com", "dkim": { "result": "pass", "domain": "example.com", "selector": "mail" }, "dmarc": { "result": "pass", "domain": "example.com", "policy": "none" }, "spf": { "result": "pass", "domain": "example.com" } }, "attachments": [ { "filename": "receipt.pdf", "content_type": "application/pdf", "size": 45678, "content_id": null, "content": "JVBERi0xLjQKJeLjz9MK..." } ], "raw": { "url": "https://storage.lettermint.co/inbound/raw/f47ac10b-58cc-4372-a567-0e02b2c3d479?expires=..&signature=..", "expires_at": "2025-10-30T14:30:00+00:00" }, "is_spam": false, "spam_score": 1.2, "spam_symbols": [ { "name": "DKIM_VALID", "score": -0.1, "options": [], "description": "Message has valid DKIM signature" }, { "name": "SPF_PASS", "score": -0.1, "options": [], "description": "SPF check passed" }, { "name": "BAYES_HAM", "score": -3.0, "options": [], "description": "Bayesian classifier identified message as non-spam" } ] } }

Event envelope

FieldTypeDescription
idstringWebhook delivery ID. Lettermint reuses it when retrying the same delivery.
event"message.inbound"Event type.
timestampstringISO 8601 time when Lettermint created the event.
dataobjectParsed inbound message.

The top-level id identifies this webhook delivery. data.message_id identifies the inbound message itself.

Message data

FieldTypeDescription
routestringInbound route slug.
message_idstringStable UUID for the inbound message.
envelopeobjectSMTP connection and envelope data. This is separate from visible message headers.
fromobjectParsed visible From address.
toarrayParsed visible To addresses. The array can be empty.
ccarrayParsed visible Cc addresses. The array can be empty.
recipientstring | nullPrimary SMTP envelope recipient. Use this field for application routing.
subaddressstring | nullPlus tag from recipient, without the +.
reply_tostring | nullParsed Reply-To address.
subjectstring | nullParsed message subject.
datestringISO 8601 time when Lettermint received the message.
body.textstring | nullPlain-text body.
body.htmlstring | nullHTML body. Sanitize it before rendering.
tagstring | nullValid tag parsed from X-LM-Tag or X-Tag.
headersarrayParsed non-standard headers as name and value pairs. Standard address, subject, and date headers are represented by dedicated fields.
authentication_resultsobjectStructured DKIM, DMARC, and SPF results produced during inbound scanning.
attachmentsarrayAttachment objects in exactly one of the delivery shapes below. The array can be empty.
rawobjectAlways-present signed reference to the original .eml message.
is_spambooleanWhether the configured route threshold classified the message as spam.
spam_scorenumber | nullScore produced by inbound spam scanning.
spam_symbolsarray | nullDiagnostic scanner symbols. Use authentication_results for stable authentication decisions.

Each address in from, to, and cc contains email, nullable name, and nullable subaddress. Envelope fields remote_ip, remote_hostname, helo, and mail_from are strings or null when the SMTP session did not provide a usable value.

authentication_results always contains authserv_id, an RFC-style header string, and structured dkim, dmarc, and spf objects. Each method has a result. Related domain, selector, and policy fields can be null. A result can be pass, fail, softfail, neutral, temperror, permerror, none, or unknown.

Attachment delivery shapes

Every attachment contains nullable filename, a content_type string, nullable integer size, and nullable content_id. The remaining fields depend on the route's Attachments setting:

ModePresent fieldsAbsent fields
Inlinecontent with Base64-encoded bytesurl, expires_at
Signed URLurl, expires_atcontent

The raw object always contains url and expires_at. Attachment and raw-message signed URLs expire after 28 days. See Attachments and raw email for configuration and secure processing guidance.

Verify the webhook signature before trusting these fields. See Signed webhooks for complete examples.

Test events

webhook.test

Special event that can be triggered from the Dashboard for connectivity testing.

Code
{ "id": "test-7f9c8e2a-1b3d-4f6e-b7d2-5c9f3a7e8b0c", "event": "webhook.test", "timestamp": "2025-08-08T20:14:12.000Z", "data": { "message": "This is a test webhook from Lettermint", "webhook_id": "9f9bf19c-4a2c-45f3-a6c7-bc937224ec5a", "timestamp": 1754921294 } }

Next Steps

  • Signed Webhooks: Verify the authenticity of webhook payloads.
  • Quick introduction: Learn about all the events Lettermint sends.
Last modified on August 7, 2026
IntroductionSigned webhooks
On this page
  • Common envelope
  • Event payloads
    • message.created
    • message.sent
    • message.delivered
    • message.auto_replied
    • message.hard_bounced
    • message.soft_bounced
    • message.spam_complaint
    • message.failed
    • message.suppressed
    • message.policy_rejected
    • message.unsubscribed
    • message.opened
    • message.clicked
  • Suppression events
    • suppression.added
    • suppression.removed
  • Inbound events
    • message.inbound
    • Event envelope
    • Message data
    • Attachment delivery shapes
  • Test events
    • webhook.test
  • Next Steps
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON