Advanced / sandbox
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 }'
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"
}'
{
"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
| Endpoint | Action behind it |
|---|---|
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 |
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.
- 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 the404collapse of the other endpoints. Only an automation outside a personal access token's content access returns404. - Each request costs
1xbase credits. - The legacy paths
POST /v1/workflow/{automation_id}/triggerandPOST /v1/workflow/weblink/generatestay 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.
/v1/automation/{automation_id}/triggerapi.tapeapp.comcurl -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_calledtrigger. - Tape applies the target's filter. A record that doesn't match creates no run.
202means Tape accepted the call, not that it created a run. The call still answers202and 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.
- its trigger isn't
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:runreturns403. - 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
trigger_on_record_id | integer | yes | The record to run the automation on. |
triggered_by_record_id | integer | no | The record that started the call. |
triggered_by_workflow_def_id | integer | no | The automation that started the call. |
trigger_with_arguments | object | no | Values for the automation's custom input variables, keyed by internal variable name. See the note below. |
is_manual_run | boolean | no | Defaults to false. |
is_simulation | boolean | no | Defaults to false. |
trigger_with_arguments key?Each key is the automation's internal variable name. Tape builds it from the label you declared:
- Lower-case the label.
- Replace every character outside
0-9,a-z,A-Z,_and$with an underscore. - 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_
| Declared label | Argument key |
|---|---|
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.
Generate a weblink
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.
/v1/automation/weblink/generateapi.tapeapp.comcurl -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"
}'
{
"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 productionhttps://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_idandtrigger_on_record_idin 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_clickedautomation returns400. - A request without a credential returns
401. - A token without
automations:runreturns403. - 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
trigger_workflow_def_id | integer | yes | The weblink_clicked automation the weblink fires. |
trigger_on_record_id | integer | yes | The record the weblink belongs to. |
triggered_by_record_id | integer | no | The record that started the generation. |
triggered_by_workflow_def_id | integer | no | The automation that started the generation. |
trigger_with_arguments | object | no | Arguments the weblink carries into the run, keyed by internal variable name, as for Call an automation. |
expiration_type | string | no | One of NEVER, ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR. |
expire_after_first_click | boolean | no | Make the weblink invalid after its first click. |
is_manual_run | boolean | no | Defaults to false. |
is_simulation | boolean | no | Defaults to false. |
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.