Skip to main content

Trigger a prebuilt automation

Automations are a powerful tool within the Vendasta platform, they can be used to set up unique workflows and create efficienciencies.

If you have setup automations in the Vendasta platform you can trigger them for a business. This enables you to set up a complex chain of actions but only need one api call.

Learn more about automations

Setup:

Create an access token with at least business scopes following the Authorization guide.

Create an automation in the Vendasta platform with the "It's triggered via API" trigger.

If you would like to pass custom data to this automation, you will also need to configure the return values to be the keys of the data payload that you are passing. This can be done by adding the keys of your data dictionary to the return values in the side panel of the trigger. By selecting the correct data types when configuring these return values, the automation will be able to automatically use this data for requirements of subsequent steps.

Step 1: Trigger the automation

You will need the ID of the automation you previously created as well as the business ID of the business location you would like to trigger that automation for. Add the access token to the headers and send it off.

This api call has an empty response.

curl -X POST 'https://prod.apigateway.co/platform/automationRuns' \
-H 'Authorization: Bearer <Token with "business" scope>' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "automationRuns",
"relationships": {
"businessLocation": {
"data": {"id": "AG-6TRBKMP2BQ", "type": "businessLocations"}
},
"automation": {
"data": {"id": "Automation-254551a2-ab4c-41fa-b7c2-1c53d448e258", "type": "automations"}
}
}
}
}'

For more details on this endpoint see Create Automation Runs.