event object and an emailMessage object. The emailMessage object remains the same across all events for a given email, allowing you to correlate events using the messageID.
For a detailed explanation of the email lifecycle and what each event type means, see Understanding Webhook Event Lifecycle.
event object contains information about the specific webhook event that occurred.
| Field | Type | Description | Present In |
|---|---|---|---|
eventID | string | Unique identifier for this specific event. Use this to deduplicate events if your webhook endpoint receives the same event multiple times due to retries. | All events |
type | integer | Numeric code indicating the type of event. See the Event Types table below for all possible values. | All events |
messageID | string | Unique identifier for the email message. This ID remains consistent across all events for the same email, allowing you to correlate events throughout the email lifecycle. | All events |
submittedAt | integer | Unix timestamp (in seconds) indicating when this specific event occurred in SendPost. For example, when the email was processed, delivered, opened, or clicked. Use this to track the exact timing of each event in the email lifecycle. | All events |
smtpCode | integer | The SMTP response code returned by the recipient’s mail server. Common codes: 200-299 (success), 400-499 (temporary failure), 500-599 (permanent failure). | Delivered, SoftBounced, HardBounced |
smtpDescription | string | Human-readable description of the SMTP response. Provides context about why an email was delivered, bounced, or rejected. | Delivered, SoftBounced, HardBounced |
eventMetadata | object | Contains additional metadata specific to the event type. The fields present vary depending on the event type. | All events (contents vary) |
type field in the event object:
| Webhook Event | Type Field Value | Description |
|---|---|---|
| Processed | 0 | Email has been accepted by SendPost and is queued for delivery |
| Dropped | 1 | Email was not sent due to suppression list, invalid recipient, or policy violation |
| Delivered | 2 | Email was successfully delivered to the recipient’s mail server |
| SoftBounced | 3 | Email delivery temporarily failed; SendPost will retry delivery |
| HardBounced | 4 | Email delivery permanently failed; the recipient address is invalid or doesn’t exist |
| Opened | 5 | Recipient opened the email (requires tracking pixel) |
| Clicked | 6 | Recipient clicked a link in the email (requires link tracking) |
| Unsubscribed | 7 | Recipient unsubscribed via the unsubscribe link |
| Spam | 8 | Recipient marked the email as spam |
eventMetadata object contains event-specific information. Different fields are populated depending on the event type.
| Field | Type | Description | Present In |
|---|---|---|---|
clickedURL | string | The full URL that the recipient clicked. Only present when a link click is tracked. | Clicked |
smtpCode | integer | Duplicate of event.smtpCode for convenience. The SMTP response code from the recipient’s mail server. | Delivered, SoftBounced, HardBounced |
smtpDescription | string | Duplicate of event.smtpDescription for convenience. Human-readable SMTP response description. | Delivered, SoftBounced, HardBounced |
userAgent | object | Parsed user agent information identifying the email client or browser used to open/click. | Opened, Clicked |
os | object | Parsed operating system information of the device used to open/click. | Opened, Clicked |
device | object | Parsed device information identifying the hardware used to open/click. | Opened, Clicked |
geo | object | Geographic location information based on the IP address of the recipient when they opened/clicked. | Opened, Clicked |
trackedIP | string | The IP address of the recipient when they clicked a link. | Clicked |
rawUserAgent | string | The raw, unparsed User-Agent string from the recipient’s browser or email client. | Opened, Clicked |
userAgent object provides parsed browser/email client information:
| Field | Type | Description | Example |
|---|---|---|---|
Family | string | Name of the browser or email client | ”Chrome”, “Safari”, “Outlook”, “Gmail” |
Major | string | Major version number of the browser/client | ”91”, “15”, “16” |
Minor | string | Minor version number of the browser/client | ”0”, “4”, “2” |
Patch | string | Patch version number of the browser/client | ”4472”, “1”, “0” |
os object provides parsed operating system information:
| Field | Type | Description | Example |
|---|---|---|---|
Family | string | Name of the operating system | ”Windows”, “Mac OS X”, “iOS”, “Android”, “Linux” |
Major | string | Major version number of the OS | ”10”, “14”, “12” |
Minor | string | Minor version number of the OS | ”0”, “5”, “1” |
Patch | string | Patch version number of the OS | ”19041”, “1”, “0” |
PatchMinor | string | Additional patch version detail (if available) | “1” |
device object provides parsed hardware device information:
| Field | Type | Description | Example |
|---|---|---|---|
Family | string | General category or name of the device | ”iPhone”, “iPad”, “Samsung”, “Other” |
Brand | string | Brand/manufacturer of the device | ”Apple”, “Samsung”, “Google”, “Unknown” |
Model | string | Specific model of the device | ”iPhone 13”, “Galaxy S21”, “Pixel 6” |
geo object provides geographic location information based on IP geolocation:
| Field | Type | Description | Example |
|---|---|---|---|
countryCode | string | ISO 3166-1 alpha-2 country code | ”US”, “GB”, “DE” |
regionCode | string | Region/state code | ”CA”, “NY”, “TX” |
postalCode | string | Postal or ZIP code | ”94102”, “10001”, “SW1A 1AA” |
timezone | string | IANA timezone identifier | ”America/Los_Angeles”, “Europe/London” |
emailMessage object contains information about the original email that was sent. This object remains identical across all webhook events for the same email.
| Field | Type | Description | Present In |
|---|---|---|---|
messageID | string | Unique identifier for the email message. Matches event.messageID and can be used to correlate events across the email lifecycle. | All events |
from | object | The sender information for the email. Contains the sender’s email address and display name. | All events |
to | array | Array of recipient objects. Each object contains the recipient’s email address and display name. | All events |
subject | string | The subject line of the email as it was sent. | All events |
emailType | string | The classification type of the email. Common values include transactional for system-generated emails (receipts, password resets, notifications) and marketing for promotional content. This helps distinguish email purposes for analytics and compliance. | All events |
ipID | integer | The unique identifier of the specific IP address used to send this email. Use this to track which IP was used for delivery, useful for troubleshooting deliverability issues. | All events |
ipPoolID | integer | The unique identifier of the IP pool from which the sending IP was selected. IP pools group multiple IPs together for load balancing and reputation management. | All events |
ipPool | string | The name of the IP pool used for sending this email. This is the human-readable name assigned to the IP pool, making it easier to identify which pool was used without looking up the ID. | All events |
publicIP | string | The actual public IP address used by SendPost to deliver this email to the recipient’s mail server. This is the IP that receiving servers see and is important for monitoring sender reputation. | All events |
headers | object | Key-value pairs of custom headers that were included in the original email request. Use these for tracking campaigns, orders, or custom metadata. | All events (if headers were sent) |
groups | array | Array of group names/tags that were assigned to the email for classification and filtering purposes. | All events (if groups were assigned) |
from object contains sender information:
| Field | Type | Description | Example |
|---|---|---|---|
email | string | The email address of the sender | ”[email protected]” |
name | string | The display name of the sender (shown in email clients) | “Support Team”, “John Doe” |
to array represents a recipient:
| Field | Type | Description | Example |
|---|---|---|---|
email | string | The email address of the recipient | ”[email protected]” |
name | string | The display name of the recipient | ”John Doe”, “Jane Smith” |
headers object is a key-value store for custom headers:
| Field | Type | Description | Example |
|---|---|---|---|
{key} | string | Any custom header key you included in your email request | "X-Campaign-Id": "summer-2024" |
groups array contains classification tags:
| Field | Type | Description | Example |
|---|---|---|---|
groups[n] | string | A group/tag name assigned to categorize the email | ”transactional”, “marketing”, “order-confirmation” |
| Event Type | smtpCode Available | smtpDescription Available | Location in Payload |
|---|---|---|---|
| Processed (0) | ❌ No | ❌ No | N/A |
| Dropped (1) | ❌ No | ❌ No | N/A |
| Delivered (2) | ✅ Yes | ✅ Yes | event.smtpCode, event.smtpDescription, event.eventMetadata.smtpCode, event.eventMetadata.smtpDescription |
| SoftBounced (3) | ✅ Yes | ✅ Yes | event.smtpCode, event.smtpDescription, event.eventMetadata.smtpCode, event.eventMetadata.smtpDescription |
| HardBounced (4) | ✅ Yes | ✅ Yes | event.smtpCode, event.smtpDescription, event.eventMetadata.smtpCode, event.eventMetadata.smtpDescription |
| Opened (5) | ❌ No | ❌ No | N/A |
| Clicked (6) | ❌ No | ❌ No | N/A |
| Unsubscribed (7) | ❌ No | ❌ No | N/A |
| Spam (8) | ❌ No | ❌ No | N/A |
| Code Range | Category | Description |
|---|---|---|
| 200-299 | Success | Email was accepted and delivered successfully |
| 250 | Success | Requested mail action completed |
| 421 | Temporary | Service not available, try again later |
| 450 | Temporary | Mailbox unavailable (busy or temporarily blocked) |
| 451 | Temporary | Local error in processing |
| 452 | Temporary | Insufficient storage |
| 500 | Permanent | Syntax error, command unrecognized |
| 550 | Permanent | Mailbox unavailable (not found or policy rejection) |
| 551 | Permanent | User not local |
| 552 | Permanent | Message size exceeds limit |
| 553 | Permanent | Mailbox name not allowed |
| 554 | Permanent | Transaction failed |
event object and within event.eventMetadata. Both locations contain the same values for consistency and ease of access.emailMessage.headers object in all webhook events (Processed, Dropped, Delivered, Opened, Clicked, Bounced, Unsubscribed, Spam).