Learn how to define app event types so that you can send event occurrence data into HubSpot.
7.6.0
or later. You can check which version of the CLI you have by running hs --version
, and update by running npm install -g @hubspot/cli@latest
.App configuration and project structure
hsmeta.json
file to include the timeline
scope in the requiredScopes
field. This is required for app event data to appear on CRM record timelines. Installers must grant this scope for your event data to send successfully.app/
directory of your project, add an app-events
directory. In app-events/
, add a JSON configuration file to define the app event type. This file can have any name, but must end in *-hsmeta.json
. You can include up to 750 event types per app, with each having its own *-hsmeta.json
file.Configure the event type schema
*-hsmeta.json
file, set up your event type schema. This schema will configure event type attributes such as name, CRM record timeline display template, and the CRM object type to associate event data with.While some of these fields can be updated after creation, the name
and objectType
fields cannot be changed once the event type is created.For example, the following event type schema could be used for tracking customer login events.Fields marked with * are required.
Field | Type | Description |
---|---|---|
uid * | String | An internal unique identifier for the event type. |
type * | String | The type of component. Must be app-event . |
name * | String | The label displayed in HubSpot (up to 50 characters). This value cannot be updated after creation. |
objectType * | String | The fully qualified name of the CRM object type that event occurrences can be associated with. This value cannot be changed after creation. Can be one of: COMPANY , CONTACT , DEAL , TICKET , APP_OBJECT . To create an event type for custom objects, use the supportsCustomObject field instead. |
supportsCustomObject | Boolean | Set to true to configure the app event type for custom objects. When set to true :
|
headerTemplate | String | The rendering template for the header of the CRM timeline activity card. Can be up to 1,000 characters in length. |
detailTemplate | String | The rendering template for the body of the CRM timeline activity card. Can be up to 10,000 characters in length. |
properties | Array | Properties defined for the event type that you’ll store event occurrence data in. Each event type can have up to 500 properties. Learn more about properties, including requirements and limitations, in the app events reference documentation. |
Upload your changes to HubSpot
hs project upload
command.hs project deploy
.After deploying, your app event type will now be available and can be used for receiving event occurrence data.fullyQualifiedName
via the app events API. This name identifies the event type, and will need to be included with all app event API operations.
To retrieve the eventTypeName
, make a POST
request to https://api.hubapi.com/integrators/timeline/v4/types/projects
. In the request body, include:
projectName
field, which should be set to the name
value from the hsproject.json
file of your project.developerSymbol
field, which should be set to the uid
value from the event type *-hsmeta.json
configuration file.fullyQualifiedName
.
fullyQualifiedName
value will never change, so you can safely hard code it into your implementation. The API limits the number of times you can retrieve this value per day, and cannot be used programmatically.
*-hsmeta.json
event type configuration file from your project, then upload and deploy the project.v1
/v3
) to the developer platform, you’ll have 7 days to change existing v1
/v3
timeline event API requests to the new v4
endpoints, including both event type event occurrence/instance API requests. After 7 days, any existing calls to v1
/v3
event occurrence endpoints will return 401
errors.
v4
endpoints, which offers both single and batch send endpoints.hs app migrate
, then follow the terminal prompts to migrate your app and timeline event.hs project open
.*-hsmeta.json
) may contain fields with null
values. These fields are an artifact from the migration, and it’s safe to remove them.