Skip to main content
Automation API

Advanced / sandbox

Request
curl -X POST https://api.tapeapp.com/v1/automation/88/trigger \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "trigger_on_record_id": 5001 }'
Request
curl -X POST https://api.tapeapp.com/v1/automation/weblink/generate \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"trigger_workflow_def_id": 91,
"trigger_on_record_id": 5001,
"expiration_type": "ONE_WEEK"
}'
Response
{
"trigger_token": "3f2b1c94-7d6e-4a51-9b0f-2c8e5d41a7b3",
"trigger_client_url": "https://weblink.tapeapp.com/trigger/3f2b1c94-7d6e-4a51-9b0f-2c8e5d41a7b3"
}

Use these endpoints to call an automation on a record or to create a weblink that runs an automation when someone selects it.

Both endpoints are the engine behind specific automation actions: an automation uses them during its run to call another automation or to hand out a weblink. To start an automation from your own code, use manual-run instead. It works with every trigger and on a paused automation.

POST /v1/automation/{automation_id}/trigger

Call automation: current_record_call_automation, collected_records_call_automation

POST /v1/automation/weblink/generate

Generate weblink: current_record_generate_automation_weblink

Which capability do I need?

Both endpoints need Run automations (automations:run). They work with a personal access token, an OAuth access token, a user API key or an automation API key. See Capabilities.

How do these endpoints differ from the rest of the resource?
  • They also accept an automation API key. Apart from discovery, the rest of the resource doesn't.
  • They report a missing or unavailable automation or record as 400 (validation error), not with the 404 collapse of the other endpoints. Only an automation outside a personal access token's content access returns 404.
  • Each request costs 1x base credits.
  • The legacy paths POST /v1/workflow/{automation_id}/trigger and POST /v1/workflow/weblink/generate stay as deprecated aliases for older integrations. Use /v1/automation/….

Call an automation​

Use this endpoint to run an automation on a record. The Call automation actions use it.

POST/v1/automation/{automation_id}/triggerapi.tapeapp.com
Request
curl -X POST https://api.tapeapp.com/v1/automation/88/trigger \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "trigger_on_record_id": 5001 }'

The response is 202 with an empty body {}. Like manual-run, the call is asynchronous and returns no run ID. Poll Automation run for the result.

General behavior

  • The target automation needs an automation_called trigger.
  • Tape applies the target's filter. A record that doesn't match creates no run.
  • 202 means Tape accepted the call, not that it created a run. The call still answers 202 and creates no run when the target doesn't fire:
    • its trigger isn't automation_called,
    • its filter rejects the record, or
    • it's paused or broken. New automations start paused, so activate the target first.

Requirements: automations:run. Works with a personal access token, an OAuth access token, a user API key or an automation API key.

Errors

  • A malformed body, an automation or record that doesn't exist or that you can't access, or a record outside the automation's app returns 400.
  • A request without a credential returns 401.
  • A token without automations:run returns 403.
  • An automation outside your personal access token's content access returns 404.

Body parameters

trigger_on_record_idintegerrequired

The record to run the automation on.

triggered_by_record_idinteger

The record that started the call.

triggered_by_workflow_def_idinteger

The automation that started the call.

trigger_with_argumentsobject

Values for the automation's custom input variables, keyed by internal variable name. See the note below.

is_manual_runboolean

Defaults to false.

is_simulationboolean

Defaults to false.

How do I build a trigger_with_arguments key?

Each key is the automation's internal variable name. Tape builds it from the label you declared:

  1. Lower-case the label.
  2. Replace every character outside 0-9, a-z, A-Z, _ and $ with an underscore.
  3. Put var_ in front.

Tape doesn't trim the label, so spaces at the start or end become underscores. A variable of type file adds _<selected_property> at the end.

note

var_note

My Variable

var_my_variable

My-Variable-2

var_my_variable_2

My%Variable

var_my_variable

' My variable ' (spaces at start and end)

var__my_variable_

A key that matches no declared variable is accepted without an error: the schema is open, the variable resolves to null and the run goes on. If an argument seems to have no effect, check the key first.

Use this endpoint to create a public weblink that runs a weblink_clicked automation on a record when someone selects it. The Generate weblink action uses it.

POST/v1/automation/weblink/generateapi.tapeapp.com
Request
curl -X POST https://api.tapeapp.com/v1/automation/weblink/generate \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"trigger_workflow_def_id": 91,
"trigger_on_record_id": 5001,
"expiration_type": "ONE_WEEK"
}'
Response
{
"trigger_token": "3f2b1c94-7d6e-4a51-9b0f-2c8e5d41a7b3",
"trigger_client_url": "https://weblink.tapeapp.com/trigger/3f2b1c94-7d6e-4a51-9b0f-2c8e5d41a7b3"
}

Key fields

  • trigger_token: a UUID.
  • trigger_client_url: <weblink-client-base>/trigger/<trigger_token>. The host depends on the environment, in production https://weblink.tapeapp.com. Treat the whole URL as opaque: hand it out as is, and don't build or parse it yourself.

General behavior

  • The response is 201. The endpoint is synchronous. Only the run that a later click starts is asynchronous.
  • Send trigger_workflow_def_id and trigger_on_record_id in every request. The endpoint needs the automation to fire and the record to scope the weblink to.
  • You need view access to the record.

Requirements: automations:run. Works with a personal access token, an OAuth access token, a user API key or an automation API key.

Errors

  • A malformed body, an automation or record that doesn't exist or that you can't access, or a target that isn't a weblink_clicked automation returns 400.
  • A request without a credential returns 401.
  • A token without automations:run returns 403.
  • An automation outside your personal access token's content access returns 404.

Body parameters

trigger_workflow_def_idintegerrequired

The weblink_clicked automation the weblink fires.

trigger_on_record_idintegerrequired

The record the weblink belongs to.

triggered_by_record_idinteger

The record that started the generation.

triggered_by_workflow_def_idinteger

The automation that started the generation.

trigger_with_argumentsobject

Arguments the weblink carries into the run, keyed by internal variable name, as for Call an automation.

expiration_typestring

One of NEVER, ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR.

expire_after_first_clickboolean

Make the weblink invalid after its first click.

is_manual_runboolean

Defaults to false.

is_simulationboolean

Defaults to false.

Why does the action use a different expiration key?

expiration_type with upper-case values (NEVER, ONE_DAY, …) belongs to this endpoint's body. The current_record_generate_automation_weblink action uses weblink_expiration with lower-case values (never, one_day, one_week, one_month, one_year) and also has on_click. Don't copy the endpoint's key or casing into an action config.

Next steps​