Subscribe actions are supported for a subset of providers. See the provider guides to check whether your provider supports them. Some providers need setup in your provider app before events arrive: HubSpot, Gong, Housecall Pro, Gmail, and Zoho Mail.
Defining subscriptions
To subscribe to an object, 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: required when using
createEvent,updateEvent,deleteEvent, orassociationChangeEvent. Set this totrueso the subscribe action inherits the mapped and unmapped fields from the matching read action.trueis currently the only supported value.
createEvent, updateEvent, deleteEvent, or associationChangeEvent also needs an object with the same objectName under read. That read object doesn’t need a schedule or backfill: without them, it doesn’t read anything and only supplies the fields and mappings. Objects that only use otherEvents don’t need one.
In
amp.yaml the setting is inheritFieldsAndMapping. In an installation’s config it’s spelled inheritFieldsAndMappings, with an s.Events
Choose which events to subscribe to, and turn each one on withenabled: always (currently the only supported value):
In this example,
account gets create, update, and delete events, and update events fire only when one of three fields changes. The watched fields can be provider fields (phone) or mapped fields from the read action (notes, accountName):
Association changes
In HubSpot, association changes don’t trigger update events, so subscribe to them withassociationChangeEvent. Set includeFullRecords: true to also receive the associated record. In Salesforce, associations are fields on the record, so watch that field with updateEvent instead, like accountid on contacts.
- HubSpot
- Salesforce
Other events
Beyond the standard events that Ampersand supports, you have the ability to subscribe to any other event that the underlying platform supports. The event names listed inotherEvents must match the provider’s raw event names exactly.
For Salesforce this includes events like:
UNDELETE
{OBJECT_NAME}.restore(e.g.contact.restore){OBJECT_NAME}.merge(e.g.contact.merge)
otherEvents array to the subscribed object in your amp.yaml. If an object is subscribing only to otherEvents (no createEvent, updateEvent, or deleteEvent), it does not need its own matching entry in the read block, and inheritFieldsAndMapping is not required for that object. The read block itself must still exist on the integration.
In the example below, customers uses create, update, and delete events, so it has a matching read object and inheritFieldsAndMapping: true. job.appointments subscribes only to otherEvents, so it doesn’t need one:
otherEvents with standard events on the same object, for example createEvent plus Salesforce’s UNDELETE. Because it uses a standard event, that object needs a matching read object and inheritFieldsAndMapping: true.
Combine with read actions
Pair a subscription with a read action to get the full picture: a backfill brings in your customer’s existing records when they install, and the subscription delivers every change after that. In this example, the read action backfills all accounts and supplies the fields and mappings, and the subscription sends each change:backfill (and schedule). The read object then doesn’t read anything; it only supplies the fields and mappings for the subscription.
What you receive
Each event is delivered to your destination with the fields and mappings from the matching read action, infields and mappedFields. Each result also includes:
subscribeEventType: the event type, normalized:create,update,delete,associationUpdate(HubSpot only), orother(for other events).providerEventType: the provider’s own event type.raw: the full record from the provider.rawEvent: the provider’s original event, when available.
Stop subscribe events
Subscribe actions don’t currently have a pause endpoint, so to stop events, turn them off in the config. Ampersand then updates the subscription in the provider, which usually takes 1–2 minutes and can take up to 10. Events that arrived before then may still be delivered.For one customer
- Find the customer’s installation ID, in the Ampersand Dashboard or with the List installations endpoint.
-
Call Update an installation with
config.content.subscribe.objects.<objectName>inupdateMask. -
In the body, keep the object’s
objectName,destinationandinheritFieldsAndMappings, setcreateEvent,updateEventanddeleteEventtonever, and setotherEventsto an empty list: - Check that it worked: after a few minutes, change a record of that object in the customer’s account. No event should arrive. Other installations aren’t affected.
requiredWatchFields doesn’t lower the count: Salesforce still counts an event for every change to the object.
Turn events back on
Call Update an installation for the same object again, with the events set toalways:
For every customer
Remove the object fromsubscribe in your amp.yaml and run amp deploy. Installations that have their own subscribe config for the object keep it.
When a customer uninstalls or revokes access
Deleting an installation also removes its subscriptions from the provider. Delete it before your customer disconnects or revokes Ampersand’s access: if the provider rejects Ampersand’s credentials, the subscription can’t be removed on the provider’s side. Revoking Ampersand’s permissions or deactivating the connected user doesn’t stop events on its own. For Salesforce, the event channel stays in the customer’s org and keeps using its event limits until the subscription is removed.Not receiving events?
Check that:- Enough time has passed. The first events usually arrive 1–2 minutes after installation, and occasionally up to 10 minutes. For Salesforce, a new subscription can take 10–30 minutes to start delivering.
- Your provider app is set up. Some providers send events to Ampersand only after setup in your provider app, like HubSpot. The note at the top of this page lists the others.
- You’re changing records in the connected account. Events only come from the account your customer connected, so when testing, make your changes in that same account.
- Salesforce hasn’t hit its Change Data Capture limit. Salesforce subscriptions use Change Data Capture, and Salesforce limits how many objects an org can select for it. That limit is shared with the customer’s other tools. If it’s reached, ask the customer to free up objects, or use a scheduled read action instead.
- The object doesn’t have too many fields selected. Subscriptions fetch the read action’s fields for each changed record, so the same too-many-fields limit applies: a Salesforce object with hundreds of selected fields can fail with a
414or431error. - The subscription was created. Look for its operation in the Ampersand dashboard, or set up subscribe notifications to hear when a subscription fails.

