Learn how to create and manage generic webhook subscriptions (BETA)
EMAIL
subscriptions for the hs_email_html
and hs_email_subject
properties is not currently supported.COMMUNICATION
subscriptions for the hs_communication_body
property is not currently supported.conversation.*
and contact.privacyDeletion
events. If you want to subscribe to these events, you should use the old format for webhooks detailed in this article.POST
request to when an event triggers.POST
requests to your Target URL once any of the events associated with your active subscriptions are triggered.
POST
request to when events trigger.
POST
requests to your Target URL once any of the events associated with your active subscriptions are triggered in an account that’s installed your app.
POST
requests containing JSON formatted data from HubSpot.
To ensure that the requests you’re getting at your webhook endpoint are actually coming from HubSpot, HubSpot populates a X-HubSpot-Signature
header with a SHA-256 hash built using the client secret of your app combined with details of the request. Learn more about validating request signatures.
For generic webhook payloads, the subscriptionType will follow the format of object.*
(e.g., object.propertyChange
instead of the previous format that was specific to each object type like contact.propertyChange
). For creation, deletion, merge, restore, and property change events, the associated object type will be provided in the objectTypeId
field of the payload, as defined in the table here.
The tables below define the fields provided in different event payloads.
Field | Description |
---|---|
objectId | The ID of the object that was created, changed, or deleted. For example, for contact event changes this is the contact ID; for companies, the company ID; for deals, the deal ID; and for conversations the thread ID. |
eventId | The ID of the event that triggered this notification. This value is not guaranteed to be unique. |
subscriptionId | The ID of the subscription that triggered a notification about the event. |
portalId | The specific HubSpot account ID where the event occurred. |
appId | The ID of your public app or private app. This is used in case you have multiple applications pointing to the same webhook URL. |
label | When this event occurred as a unix timestamp (in milliseconds). |
attemptNumber | Starting at 0, which number attempt this is to notify your service of this event. If your service times-out or throws an error as describe in the Retries section below, HubSpot will attempt to send the notification again. |
changeSource | The source of the change. This can be any of the change sources that appear in contact property histories. |
subscriptionType | The webhook subscription type. This can be one of the following types: object.creation , object.deletion , object.merge , object.restore , object.propertyChange , or object.associationChange . |
objectTypeId | The type of the object that triggered the event. See the table in this article for a full reference of each objectTypeId . |
sourceId | The user or source of the triggered webhook event (e.g., a user in the HubSpot account updating a value). |
object.propertyChange
events:
Field | Description |
---|---|
propertyName | The name of the object property that changed (e.g., the city property for a contact). |
propertyValue | The new value of the property. |
object.merge
events:
Field | Description |
---|---|
primaryObjectId | The ID of the merge winner, which is the record that remains after the merge. In the HubSpot merge UI, this is the record on the right. |
mergedObjectIds | An array of IDs that represent the records that are merged into the merge winner. In the HubSpot merge UI, this is the record on the left. |
newObjectId | The ID of the record that is created as a result of the merge. This is separate from primaryObjectId because in some cases a new record is created as a result of the merge. |
numberOfPropertiesMoved | An integer representing how many properties were transferred during the merge. |
object.associationChange
events.
Field | Description |
---|---|
fromObjectTypeId | The ID of the object you’re associating. To find the ID values, refer to this list of object type IDs, or for contacts, companies, deals, tickets, and notes, you can use the object name (e.g., contact , company ). |
toObjectTypeId | The ID of the object you’re associating the record to. To find the ID values, refer to this list of object type IDs, or for contacts, companies, deals, tickets, and notes, you can use the object name (e.g., contact , company ). |
associationTypeId | The type of association you want to create. A full list of association types is provided here. |
associationCategory | Whether the association type was created by HubSpot (HUBSPOT_DEFINED ) or by a user (USER_DEFINED ). |
object.associationChange
for an objectName
of contact
will trigger on a DEAL_TO_CONTACT
association change with toObjectTypeId: 0-1
and the corresponding associationTypeId
in the payload.
associationChange
event is not currently supported for custom objects.