Please note that:
- Subscribe actions are currently only supported for some providers such as Salesforce, HubSpot, Salesloft and Zoho. Please check the provider guides to see which providers support Subscribe Actions.
- They do not produce Operations or Logs that can be viewed in the Ampersand dashboard.
- It takes 1-2 minutes, and occasionally up to 10 minutes, for the first events to arrive after the initial installation.
Defining subscriptions
To subscribe to an object, you currently need to also have a read action specified for the object. In addition, you need to specify:- objectName: to indicate which object you’d like to subscribe to. This should match the name of the object in the official documentation for the SaaS API.
- destination: the name of the destination that you’ve defined
- inheritFieldsAndMapping: for now, you must always set this to
trueto inherit the mapped and unmapped fields from the Read Action. Learn more in Fields and mapping.
- createEvent: triggers when a new record is created in the SaaS application.
-
updateEvent: triggers when any existing record is modified. The
watchFieldsAuto: allsetting ensures that you subscribe to all field changes. Alternatively, you can list specific fields to watch inrequiredWatchFields. Note: Only one ofrequiredWatchFieldsorwatchFieldsAutoshould be provided. - deleteEvent: triggers when a record is removed from the system.
- associationChangeEvent: triggers when a record’s associations have been modified. This is only supported for HubSpot. Please see Association changes.
- otherEvents: gives you the ability that listen to any other events that are available in the provide API that Ampersand doesn’t natively support. Please see Other Events.
Specify fields to watch
You can provide fields to watch for update events and specify them in a list. Note: Only one ofrequiredWatchFields or watchFieldsAuto should be provided.
Here is an example amp.yaml
amp.yaml, please see Subscribe action webhooks.
Association changes
In HubSpot, association changes do not trigger update events, you must subscribe to them specifically usingassociationChangeEvent. On the other hand, in Salesforce, you can subscribe to fields that refer to associations (e.g. You can subscribe to update events on the accountid field of contacts).
HubSpot example:
Other events
Beyond the standard events that Amperand supports, you have the ability to subscribe to any other event that that underlying platform supports. For Salesforce this includes events like:UNDELETE
{OBJECT_NAME}.restore(e.g.contact.restore){OBJECT_NAME}.merge(e.g.contact.merge)
otherEvents to your amp.yaml file:
Specify backfill behavior
By combining subscribe actions with read actions, you can get a full picture of all the data in your customer’s SaaS instance. You can:- Do a full backfill when the user first installs the integration to get historic data.
- Then, receive real-time updates about changes in their SaaS instance
amp.yaml:
Special set up for HubSpot
HubSpot subscribe actions cannot notify you of changes to custom fields. There is a workaround that requires additional set up, please contact support@withampersand.com for details.
- Define the subscribe action in your
amp.yamlfile and then deploy it, please refer to the previous section. - Make modifications to the HubSpot app.
New project apps
If you are using a new project app (that was created with the HubSpot CLI), then follow the instructions below. If you don’t have any apps yet, the then follow the instructions in the HubSpot provider guide to create one.Create webhooks-hsmeta.json file
Go to the directory that contains your HubSpot app, and add a file calledyour-project-name/src/app/webhooks/webhooks-hsmeta.json. So your directory should end up like this:
targetUrl in the example webhooks-hsmeta.json file below with the one that is for your integration. It should follow the format:
- Replace
PROJECT_IDwith your Ampersand project ID, which can be found in the Dashboard’s General Settings page. - Replace
INTEGRATION_IDwith your integration’s ID, which can be found in the Dashboard’s Home page.
webhooks-hsmeta.json:
Deploy changes to HubSpot
Once you are done editingwebhooks-hsmeta.json, deploy it using the following command:
Legacy apps
If you have a legacy app (that was created in the HubSpot UI), follow the instructions below.- Login to your HubSpot account.
- Go to the Apps section.
- Select your connected app.
- Click on Webhooks.
- Enter the Target URL:
- Replace
PROJECT_IDwith your Ampersand project ID, which can be found in the Dashboard’s General Settings page. - Replace
INTEGRATION_IDwith your integration’s ID, which can be found in the Dashboard’s Home page.
- Click Create Subscription.
- Select object types, event types, and properties.
- Select the required checkboxes for all objects.
- Click Activate.

Fields and mapping
Your read action’s set of fields and field mappings will apply to the subscribe action. When we deliver you the webhook, it will containfields and mappedFields based on the fields and mapped fields from your read action. You can learn more in Object and field mapping.

