Skip to main content
PUT
Replace a procedure trigger’s spec

Authorizations

Authorization
string
header
required

Effective API key. Send Authorization: Bearer sk-eai-...

Path Parameters

id
string
required

The trigger’s id, or its name.

Required string length: 1 - 255

Body

application/json
name
string
required

The trigger’s name, unique in the workspace: lowercase letters, digits, dots, underscores and hyphens, at most 128. It cannot be changed, and a deleted trigger’s name stays taken.

Required string length: 1 - 128
Pattern: ^[a-z0-9][a-z0-9._-]*$
procedureId
string
required

The procedure the trigger runs.

Maximum string length: 256
Pattern: ^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$
expectedRevision
integer
required

The trigger’s revision as you last read it. A trigger changed since is refused with 409.

Required range: x > 0
enabled
boolean
required

Whether the trigger is on when the request returns. true turns it on in the same request, with its runs acting as you, and needs runAs. false leaves it off and running as no one, and takes no runAs.

version
default:live

The version to run: live, which follows the procedure’s live version at each firing, or a version number to pin one.

Available options:
live
projectId
string | null

The project (listProjects id) the trigger’s runs belong to, or null for none. The procedure must be installed in it.

Required string length: 1 - 255
schedule
object | null

Fire on a schedule. Exactly one of schedule, folder and event is set.

folder
object | null

Fire for each new file in a folder.

event

The workspace event that starts a run. match narrows which events of the type do; each field given must hold, and an omitted match takes every event of the type.

inputs
object

Static input values by name, as getProcedureVersion describes them, given to every run.

runAs
enum<string>

Required when enabled is true, and refused otherwise. self: the trigger’s runs act as you, with your access when each one starts. It is the only value.

Available options:
self

Response

The trigger at its new revision: enabled and running as you after enabled: true, otherwise disabled and running as no one.

A procedure trigger. Its spec is name, procedureId, version, projectId, schedule, folder, event and inputs: send those, with enabled (and runAs to enable it), to createProcedureTrigger to copy it under a new name, or with expectedRevision set to its revision to replaceProcedureTrigger. The other fields are the trigger’s state, and a request that sends them is refused.

id
string<uuid>
required

The trigger’s id. Its name also identifies it in the item paths.

name
string
required

The trigger’s name, unique in the workspace: lowercase letters, digits, dots, underscores and hyphens, at most 128. It cannot be changed, and a deleted trigger’s name stays taken.

Required string length: 1 - 128
Pattern: ^[a-z0-9][a-z0-9._-]*$
procedureId
string
required

The procedure the trigger runs.

Maximum string length: 256
Pattern: ^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$
version
required

The version to run: live, which follows the procedure’s live version at each firing, or a version number to pin one.

Available options:
live
projectId
string | null
required

The project (listProjects id) the trigger’s runs belong to, or null for none. The procedure must be installed in it.

Required string length: 1 - 255
schedule
object | null
required

Fire on a schedule. Exactly one of schedule, folder and event is set.

folder
object | null
required

Fire for each new file in a folder.

event
required

The workspace event that starts a run. match narrows which events of the type do; each field given must hold, and an omitted match takes every event of the type.

inputs
object
required

Static input values by name, as getProcedureVersion describes them, given to every run.

kind
enum<string>
required

Which firing source is set.

Available options:
schedule,
folder,
event
revision
integer
required

The spec’s revision: 1 when created, one more after each replaceProcedureTrigger.

Required range: x > 0
enabled
boolean
required

Whether the trigger fires. Create and replace set it from their enabled; enableProcedureTrigger and disableProcedureTrigger change it.

runAs
object | null
required

Whose access the trigger’s runs use, or null before it is enabled. Create and replace do not take it back: send enabled: true with runAs: "self" to run as yourself.

nextRunAt
string<date-time> | null
required

When the schedule next fires while the trigger is enabled; null for folder and event triggers.

runCount
integer
required

Runs the trigger started.

Required range: x >= 0
lastError
object | null
required

Why the latest firing did not start a run, until a later one does; null when none failed.

runTriggerId
string
required

What the runs this trigger starts carry as cause.triggerId. Pass it as triggerId to listProcedureRuns to list them.