Create an automation

Binds a PUBLISHED script to a trigger. The automation is created ACTIVE and owned by the calling user (userId). scriptParameters and triggerParameters are merged over the script's declared schema — a supplied value overrides the script's default, an omitted key keeps it — and stored with the automation.

Validated in order: the alias is unique for the tenant, the script exists and is PUBLISHED, the requested triggerType matches the one the script declares, and the parameters fit the script's schema.

A TIME automation created ACTIVE is registered with the scheduler at this point; a later status change registers or unregisters it accordingly.

Body Params
string
required
length between 3 and 100

Human-readable label for the automation. Unique per tenant, compared case-insensitively — Payday and payday collide. Leading and trailing whitespace is trimmed before the check and before storing, and the trimmed value is what is returned. A soft-deleted (DELETED) automation releases its alias, so a tenant can recreate one under the same alias.

string
length ≤ 250
uuid
required

Id of the PUBLISHED script this automation runs.

string
enum
required

Trigger kind. Must equal the triggerType the referenced script declares — a mismatch is rejected with 400. An unrecognised value is also rejected with 400. An automation is owned by the user who creates it (userId); it is not bound to a set of accounts.

Allowed:
scriptParameters
array of objects

Values for the script's declared ${} variables. An omitted key keeps the script's declared default; a supplied value overrides it. Validated against the script's declared schema.

scriptParameters
triggerParameters
array of objects

Values for the trigger's parameters. For TIME these are occurrence (DAILY | WEEKLY | MONTHLY | ANNUALLY | ONCE | EVERY_HOUR | EVERY_MINUTE) and occurrenceDetails (a JSON object whose shape depends on the occurrence, always including timeZone; e.g. DAILY → {time, timeZone}, ONCE → {time, day, month, year, timeZone}). For BALANCE they are customerAccountToMonitor, balance, balance.comparisonType and currency. ON_DEMAND has no trigger block, so it has no trigger parameters. Omit a parameter to use the script's declared default; provide it to override.

triggerParameters
Headers
string
^\d+\.\d+\.\d+$

Version of the API contract the client targets, in MAJOR.MINOR.PATCH format. Mandated by the Gateway standard. Not yet enforced: requests without the header, or with an unsupported value, are currently processed normally. Once enforcement is enabled, such requests will be rejected with 400 Bad Request.

string
required
length ≥ 1

Required on every POST, PUT and PATCH. A client-generated key: retrying with the same key returns the original response without running the request again. Scoped per tenant, user, method and path. A missing or blank key is rejected with 400.

Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json