Introduction

The Automations V2 API allows you to manage automations on user sites. Automations are workflows that let site owners automate tasks they would otherwise have to perform manually. For example, a site owner with an online store can set up an automation to send an invoice to a customer after they make a purchase.

Learn more about Automations.

Using the Automations V2 API, you can:

Automation setup

When creating an automation, you must configure it with 1 trigger and at least 1 action. The trigger and action must already exist, as you can't create them using this API. In addition, the apps that created the trigger and actions configured in your automation must be installed on the site you're creating the automation for.

To define a trigger, specify the ID of the app that created the trigger, as well as the trigger key. You can further configure the trigger as necessary.

To add actions, provide each action's key and configuration details. Additionally, you must define your root actions. These are the first actions to run when when the automation trigger occurs.

Note: You can currently only specify 1 root action.

In addition to defining the trigger and actions, you must define the automation's origin and activation status when added to the site. An automation can have 1 of 3 possible origins:

  • User: A site owner built the automation in their site dashboard.
  • Application: An app created the automation as part of its logic. This type of automation is specific to a site, and is not necessarily created for every user who has installed the app.
  • Pre-installed: An app added the automation when it was installed on a site. Pre-installed automations aren't specific to one site, but are added to every site that installs the app.

When you create the automation, set its activation status as either active or inactive. This determines the automation's status when it's added to the site.

Did this help?