Action Instances

Before you can configure or run an action for a specific user and connection, an Action Instance needs to be created.
In many cases it is created automatically when you first try to access the action for a given connection.

Run

To run an action, do the following:

await integrationApp
  .connection('hubspot')
  .action('{ACTION_KEY}')
  .run('{INPUT}')

This request will return the result of the action that matches its outputSchema.

Get

await integrationApp
  .connection('hubspot')
  .action('{ACTION_KEY}')
  .get()

List

To list all the actions for the current customer, do the following:

await integrationApp
  .connection('hubspot')
  .actions.list()

Update

To update a customer action, do the following:

await integrationApp
  .connection('hubspot')
  .action('{ACTION_KEY}')
  .patch('{INPUT}')

Whenever you call this method, the action will be marked as customized (isCustomized set to true). To reset it back to default, use the reset method below.

Set up / Refresh

Setting up a customer action will re-fetch all the dependencies (data sources, schemas, etc.) and recalculate dynamic fields.

await integrationApp
  .connection('hubspot')
  .action('{ACTION_KEY}')
  .setup()

Reset

Resetting a customer action brings it to a default state, erasing all the customer-level configuration.

await integrationApp
  .connection('hubspot')
  .action('{ACTION_KEY}')
  .reset()

Delete

await integrationApp
  .connection('hubspot')
  .action('{ACTION_KEY}')
  .archive()