What it does
Add a Trigger: when a visitor action is applied or a row of a table changes (on), filtered by condition and runs_for, send message with an Integration. label is required. One action starts at most 3 Triggers; the plan's limit counts Triggers.
Plans
Needs a paid plan: Basic, Pro or Ultra. On other plans your agent gets an error that says so. See Limits for what each plan includes.
Parameters
| Name | Type | About |
|---|---|---|
site_idrequired | string | The id of the site. list_sites gives the ids of your sites. |
namerequired | string | The Trigger's name: a lowercase letter, then letters, digits or underscores. |
labelrequired | string | A readable name, one line of up to 80 characters. |
integrationrequired | string | The Integration it sends with. |
onrequired | object | { "actions": [names] }: when one of these visitor actions is applied (a tick, button, edit, form submit or delete). { "table": name }: when any row of that table changes, whoever changes it. |
messagerequired | object | What to send, by the Integration's service. resend: { to: [addresses], subject, text, reply_to?, from? (needed when the Integration has no default) }. slack: { text }. zapier, make, n8n, pipedream, apps_script: {} or { data } (every call sends a standard JSON event: event, trigger, integration, site_url, site_subdomain, table, action, op, actor, row_id, row (raw values), changes; data adds fields of your own, such as formatted values). custom: { method (POST, PUT, PATCH), path (added to base_url, such as "/v1/items"), body (JSON) }. subject, text, reply_to and strings in body or data may hold {{row.<column>}}, {{old.<column>}}, {{new.<column>}}, {{action}}, {{table}}, {{op}}, {{actor}}, {{site.url}}, {{site.subdomain}}, {{integration}}, {{trigger}}. A relation column can be followed one level: {{row.<relation>.<column>}} (also old., new.), empty when there is no linked row. A select shows its label; {{row.<select>.key}} its key. A row placeholder may end in a format: |number:N (decimals), |money (currency from the row's currency column) or |money:EUR, |date, |date:short, |date:long. locale (such as nl-BE) sets how formats print; default: the site's language, else en-GB. Recipients, from and path are fixed. |
description | string or null | What it is for, in plain words (up to 500 characters). null clears it. |
condition | object or null | Only when: column, op and value (no value for is_empty and is_not_empty). null runs on every change. |
runs_for | array of one of: owner, member, share, public, agent | Who may start it: owner, member, share (share links), public, agent (agents and API keys). Default all. |
enabled | boolean | false switches this Trigger off; other Triggers on the same Integration go on. |
idempotency_key | string | Any unique string (1-200 printable ASCII). A retry with the same key and arguments returns the first call's result instead of running again. Same as the Idempotency-Key header. |
Example
Call define_trigger with these arguments:
{
"site_id": "01a1…",
"name": "new_invoice",
"label": "Slack · new invoice",
"integration": "slack_alerts",
"on": { "table": "invoices" },
"condition": { "column": "number", "op": "changes_from", "value": null },
"message": { "text": "New invoice {{row.number}}: {{row.amount|money}}" }
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- When to send, and whatTriggers: what starts them and what they send.
- Zapier, Make and moreWhat Zapier, Make, n8n, Pipedream and Apps Script receive.