Skip to main content

The Email Events API is used to get information about events generated by marketing emails or email campaigns sent through a HubSpot account.

Use case for this API: if a member of your marketing team wants to optimize email campaigns, you can use the Email Events API to gather data and power a machine learning model that determines the best time to send emails to different contact segments.

Every email sent via HubSpot generates a number of events detailing its lifecycle and how the recipient interacts with its content. An event is uniquely identified by its EventId, which is comprised of the following properties:

Property nameTypeDescription
idstringA randomly-generated ID for this event.
created64-bit integerThe timestamp (in milliseconds since epoch) when this event was created.

These properties can be used to look up a specific event via this endpoint.

Further, all but one event type (UNBOUNCE) have the following properties:

Property nameTypeDescription
typestring (enumeration)The type of event. See below for more information on event types.
recipientstringThe email address of the recipient of the email message.
portalId32-bit integerAn ID referencing the HubSpot account that sent the email message. This will correspond to your account.
appId32-bit integerAn ID referencing the HubSpot application that sent the email message.
appNamestringThe name of the HubSpot application that sent the email message. Note that this is a derived value, and may be modified at any time.
emailCampaignId64-bit integerAn ID referencing the email campaign which the email message is part of. Additional information on the email campaign can be found via this endpoint.

Events can be looked up in bulk via this endpoint using 'recipient', both 'appId' and 'campaignId', or any combination of the above properties.

The following additional properties are also available for all event types (including UNBOUNCE):

Property nameTypeDescription
sentByJSONThe EventId which uniquely identifies the email message's SENT event. If not applicable, this property is omitted.
obsoletedByJSONThe EventId which uniquely identifies the follow-on event which makes this current event obsolete. If not applicable, this property is omitted.
causedByJSONThe EventId which uniquely identifies the event which directly caused this event. If not applicable, this property is omitted.

The event reference properties -- 'sentBy', 'obsoletedBy', and 'causedBy' -- are discussed in detail later in this document.

There are 12 event types that can be generated by HubSpot's Email API during the lifecycle of an email message. They are broadly grouped into categories: Submission, Delivery, User Engagement, and User Status. Event types, event categories, and their relationships are diagrammed below.

Event typeDescription
SENTThe message was sent to and received by our delivery provider, which has queued it for further handling.
DROPPEDThe message was rejected, either by HubSpot or by our delivery provider, and no attempt will be made to deliver the message.
PROCESSEDThe message has been received by our delivery provider, which has indicated it will attempt to deliver the message to the recipient's email server.
DELIVEREDThe recipient's email server has accepted the message and the message has been successfully delivered to the recipient.
DEFERREDThe recipient’s email server has temporarily rejected message, and subsequent attempts will be made to deliver the message.
BOUNCEThe recipient's email server couldn't or wouldn't accept the message, and no further attempts will be made to deliver the message.
OPENThe recipient opened the message.
CLICKThe recipient clicked on a link within the message.
STATUSCHANGEThe recipient changed their email subscriptions in some way.
SPAMREPORTThe recipient flagged the message as spam.
SUPPRESSIONThe message was not sent, the recipient has been unengaged with previous marketing emails.

When an email message is created and sent by HubSpot on behalf of a customer, we first verify whether the recipient is eligible to receive it. If not, we reject the message, triggering the creation of a DROPPED event. Otherwise, we submit it to our delivery provider for further handling, triggering a SENT event. An email message will almost always have exactly one submission event associated with it; for example, there will never be multiple SENT events for a message.

We make every effort to reject messages before passing them along to our delivery provider. However, sometimes our delivery provider will decide to reject a message even after we have verified its eligibility. This follow-on rejection results in a DROPPED event being created, in addition to the previously-created SENT event.

Submission events all share the following properties:

Property nameTypeDescription
subjectstringThe subject line of the email message.
fromstringThe 'from' field of the email message.
replyTolist of stringsThe 'reply-to' field of the email message.
cclist of stringsThe 'cc' field of the email message.
bcclist of stringsThe 'bcc' field of the email message.

Additionally, DROPPED events have the following properties:

Property nameTypeDescription
dropReasonstring (enumeration)The reason why the email message was dropped. See below for the possible values.
dropMessagestringThe raw message describing why the email message was dropped. This will usually provide additional details beyond 'dropReason'.
Drop reasonDescription
PREVIOUSLY_BOUNCEDA previous message to the recipient resulted in a bounce.
PREVIOUS_SPAMA previous message to the recipient was flagged as spam.
PREVIOUSLY_UNSUBSCRIBED_MESSAGEThe recipient previously unsubscribed from this subscription.
PREVIOUSLY_UNSUBSCRIBED_PORTALThe recipient previously unsubscribed from all subscriptions from the account.
INVALID_TO_ADDRESSThe email address in the 'to' field failed validation.
INVALID_FROM_ADDRESSThe email address in the 'from' field failed validation.
BLOCKED_DOMAINThe recipient's domain was blocked.
BLOCKED_ADDRESSThe recipient explicitly requested to not receive any emails via HubSpot.
EMAIL_UNCONFIRMEDDouble opt-in was enabled and the recipient had not yet confirmed their subscription.
CAMPAIGN_CANCELLEDThe associated email campaign was canceled.
MTA_IGNOREOur delivery provider decided to drop the message. Any additional details will be included in 'dropMessage'.
PORTAL_OVER_LIMITYour account went over its monthly limit for email sends.
PORTAL_SUSPENDEDYour account was suspended for non-compliance or deliverability issues.
QUARANTINED_ADDRESSThe recipient has been quarantined due to repeated hard bounce rates.
ADDRESS_LIST_BOMBED The recipient has been quarantined due to suspicious form activity. Learn more.

Once our delivery provider has accepted an email message, we create a PROCESSED event. At this point, the delivery provider has queued the message for delivery. If everything goes smoothly, the delivery provider will dequeue the message and deliver it to the recipient's email server, generating a DELIVERED event.

Occasionally, things don't go smoothly, and one of two things happens: delivery is deferred because of a temporary rejection, or delivery fails and won't be retried.

In the first case, the message could not be delivered to the recipient's email server for some non-fatal (usually transient reason, such as a spurious time-out. The delivery provider will re-queue the message for later delivery, and we create a DEFERRED event. A message can be deferred multiple times before it completes the delivery phase, with a new event created on each attempt.

If delivery fails, no further attempts will be made to deliver the message, and we create a BOUNCE event. This can occur for a variety of reasons, such as the recipient being unknown by the email server.

The specific delivery event types have the following properties:

Property nameTypeDescription
responsestringThe full response from the recipient's email server.
smtpIdstringAn ID attached to the message by HubSpot.
Property nameTypeDescription
responsestringThe full response from the recipient's email server.
attempt32-bit integerThe delivery attempt number.
Property nameTypeDescription
categorystring (enumeration)The best-guess of the type of bounce encountered. If an appropriate category couldn't be determined, this property is omitted. See below for the possible values. Note that this is a derived value, and may be modified at any time to improve the accuracy of classification.
responsestringThe full response from the recipient's email server.
statusstringThe status code returned from the recipient's email server.
Bounce categoryDescription
UNKNOWN_USERThe recipient didn't exist.
MAILBOX_FULLThe recipient's mailbox was full and couldn't receive any messages.
CONTENTThe recipient's filters identified content in the body of the email as suspicious or spammy.
SPAMThe message was flagged as spam.
POLICYThe message was flagged as spam.
GREYLISTINGThe email server requires a longer history of email activity from the sender.
MAILBOX_MISCONFIGURATIONA mailbox misconfiguration was detected.
ISP_MISCONFIGURATIONAn ISP misconfiguration was detected.
DOMAIN_REPUTATIONThe sending domain has a poor reputation or a reputation that doesn't meet the standards of the recipient server.
DMARCThe sender’s domain does not pass a DMARC check. Please review your SPF and DMARC policies.
SENDING_DOMAIN_MISCONFIGURATIONDomain authentication failed due to a policy on the recipient's end.
TIMEOUTThe receiving email server timed out and is no longer accepting email.
THROTTLEDThe recipient's email server was throttling messages.
UNCATEGORIZEDAn uncategorized error was detected.
IP_REPUTATIONThe message originated from a suspicious (or previously unknown) IP address.
DNS_FAILUREThe recipient’s domain name server settings were misconfigured at the time the email was sent.
TEMPORARY_PROBLEMSome temporary problem occurred.

Once an email message reaches its recipient, there are four different event types that can occur: OPEN, CLICK, PRINT, and FORWARD. These represent the recipient's interaction with the message and its content, and each can occur multiple times. For example, each time any URL is clicked, a new CLICK event is created, even if that URL has previously been clicked and generated such an event.

User engagement events all share the following properties:

Property nameTypeDescription
userAgentstringThe user agent responsible for the event, e.g. “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
browserJSONA JSON object representing the browser which serviced the event. Its comprised of the properties: 'name', 'family', 'producer', 'producer_url', 'type', 'url', 'version'.
locationJSONA JSON object representing the location where the event occurred. It's comprised of the properties: 'city', 'state', 'country'.
filteredEventbooleanA boolean representing whether the event has been filtered out of reporting based on customer reports settings or not.

Additionally, CLICK events have the following properties:

Property nameTypeDescription
urlstringThe URL within the message that the recipient clicked.
refererstringThe URL of the webpage that linked to the URL clicked. Whether this is provided, and what its value is, is determined by the recipient's email client.

And OPEN events may have the following property:

Property nameTypeDescription
duration64-bit integer (milliseconds)If provided and nonzero, the approximate number of milliseconds the user had opened the email.

A recipient can also update their communication preferences via the email message. By clicking on the subscription preferences link in the message, they can change their subscriptions, either subscribing or unsubscribing from various lists, triggering a STATUSCHANGE event. Note that a status change can be for any list(s), not just the one which is associated with the current email message.

An email message may also be flagged as spam by the recipient, resulting in a SPAMREPORT event. Note that this is independent of subscription status — flagging a message as spam does not simply unsubscribe the recipient from the list in question. Rather, the subscription status is left unchanged, and a flag is set indicating that recipient should never receive another email message from HubSpot. Once this happens, you'll need manual intervention by HubSpot to remove the flag.

A STATUSCHANGE event has the following additional properties:

Property nameTypeDescription
sourcestring (enumeration)The source of the subscription change. See below for the possible values.
requestedBystringThe email address of the person requesting the change on behalf of the recipient. If not applicable, this property is omitted.
portalSubscriptionStatusstring (enumeration, 'SUBSCRIBED' or 'UNSUBSCRIBED')The recipient's portal subscription status. (Note that if this is 'UNSUBSCRIBED', the property 'subscriptions' is not necessarily an empty array, nor are all subscriptions contained in it necessarily going to have their statuses set to 'UNSUBSCRIBED'.)
subscriptionsJSONAn array of JSON objects representing the status of subscriptions for the recipient. Each JSON subscription object is comprised of the properties: 'id', 'status'.
bouncedboolean (true, or omitted entirely)A HubSpot employee explicitly initiated the status change to block messages to the recipient. (Note this usage has been deprecated in favor of dropping messages with a 'dropReason' of BLOCKED\_ADDRESS.)
SourceDescription
SOURCE_LIST_UNSUBSCRIBEThe recipient used a list-unsubscribe header.
SOURCE_RECIPIENTThe recipient used the subscription UI.
SOURCE_IMPORTThe customer imported the subscriptions into their portal.
SOURCE_HUBSPOT_CUSTOMERThe customer used the subscription UI.
SOURCE_SPAM_REPORTA spam report generated by an automated system was received.
SOURCE_NON_DELIVERY_REPORTA non-delivery report (typically a bounce) was received.
SOURCE_DIRECT_COMPLAINTA direct complaint via abuse@hubspot.com was received.
SOURCE_MTA_RECORDOur delivery provider provided the change, during our normal synchronization with their system-of-record.
SOURCE_HUBSPOTA HubSpot employee made the change.
SOURCE_MIGRATIONHubSpot migrated the subscriptions from a previous version of the product.
SOURCE_HUBSPOT_CLEANUPHubSpot cleaned up the subscriptions.
SOURCE_KNOWN_SPAM_TRAPThis recipient address is a known spam trap, and should not receive emails.

There is a 13th event type, which is unrelated to a specific email message. UNBOUNCE events occur when a particular email address is either automatically or manually unbounced by HubSpot. This resets the bounce status of the recipient, potentially allowing them to receive emails from your portal.

Property nameTypeDescription
userstringThe email address of the user who submitted the unbounce request.

Many events are related to other events that occurred either before or after it. As described in the first section above, we use EventIds to build this reference chain.

Note that event references are relatively new, and older events may not have them populated.

As discussed previously, each email message has either a SENT or DROPPED event (or one of each) associated with it. This will be the first event generated for any given message. If a message generates a SENT event, all subsequently generated events will reference that event via the property 'sentBy'.

This backward-reference can be useful to get more information on the parent SENT event, or to manually find all events associated with a given message.

Sometimes, a follow-on event occurs for a given message, signifying that an earlier event should be ignored. This relationship is captured in a forward-reference in the property 'obsoletedBy'.

For instance, in the case where we generate both a SENT event and a subsequent DROPPED event, the SENT event is ultimately irrelevant, and is obsoleted by the DROPPED event. Accordingly, the SENT event will reference the DROPPED event via 'obsoletedBy'.

Certain events occur precisely because of some previous event, often for a different message. This relationship is captured in a backward-reference in the property 'causedBy'. It can be used to get additional details on why a particular event caused the following event.

For example, a DROPPED event will occur when there was a previous BOUNCE event for the same recipient. In this case, the DROPPED event will have its 'dropReason' set to PREVIOUSLY\_BOUNCED, and it's 'causedBy' will reference that previous BOUNCE event.