Sending event occurrences
- Send a single occurrence
- Send a batch of occurrences
To send a single event occurrence, make a
POST request to /integrators/timeline/v4/events.In the request body, include the following:- The event data following the event type’s defined schema, along with the
idof the CRM record to associate with the event occurrence. - The
fullyQualifiedNamevalue in aeventTypeNamefield. This value can either be your app’suiddefined in the top-level*-hsmeta.jsonfile, orfullyQualifiedNamereturned from the/integrators/timeline/v4/types/projectsAPI.
Fields marked with * are required.
CRM record association
Each event occurrence must be associated with a CRM record, with the CRM object type defined by the event type schema. The app events API includes multiple fields for associating event occurrence data with CRM records. For all supported CRM objects, it’s recommended to use theobjectId field. However, there are some situations where you may want to use the other fields.
utk/email: if you don’t know the contact’s ID, use theutkand/oremailfield for identification. Providing both of these identifiers also enables you to create and update contacts. For example:- If
utkmatches an existing contact but theemaildoesn’t match, HubSpot will update the contact (byutk) with the new email address. - If no
objectIdis provided, the event occurrence will associate with an existing contact that matches theutk/email, or HubSpot will create a new contact if no match is found. - Note that the
utkalone cannot create new contacts. You should always includeemailwithutkto ensure proper association.
- If
domain: for company association, you must provide theobjectId, but you can also includedomainto update thedomainproperty of that company.
email field is provided with other identifiers (objectId, utk), HubSpot will always update the email property on the contact record. For example, if the contact’s email is test@hubspot.com and you send an occurrence with the objectId and email as test-updated@hubspot.com, the contact’s email address property will be updated to test-updated@hubspot.com.
Below is the priority order for the CRM record association properties, with the lowest number being the highest priority:
Sending additional data
Beyond sending data to event properties and updating CRM properties via event occurrences, you can include additional data for timeline rendering via theextraData object.
extraData field values can be accessed by the event type’s detailTemplate using {{extraData.fieldName}} syntax. All attribute levels of extraData are available through dot notation, such as {{extraData.person1.preferredName}}.
For example, the templates below use the customerName and loginLocation property data, along with the surveyData field from extraData sent via the event occurrence.
- Event occurrence data
- Timeline template configuration