Create function triggers
Subscribe a function to one or more event types, optionally scoped to specific senders. Provide eventTypes and senderIds (use null in senderIds for all senders); a trigger is created for each event type and sender combination.
The special event type cron runs the function on a schedule instead of a messaging event: include a cron field with a 5-field UTC cron expression (minimum granularity one minute). A cron trigger ignores the sender axis, and a function may hold several cron triggers with different expressions. The function receives an event with type: "cron" and data.cron.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Path parameters
functionIdstringrequiredZavu Function ID.
Body
application/json
eventTypesstring[]requiredEvent types to subscribe to.
senderIdsstring[]requiredSenders to scope the triggers to. Use null for all senders.
cronstringRequired when eventTypes includes
cron: a 5-field cron expression (minute hour day-of-month month day-of-week), evaluated in UTC.
Responses
201Triggers created.
addedintegerrequiredskippedintegerrequiredNumber of triggers that already existed.
triggersobject[]required10 properties
idstringrequiredfunctionIdstringrequiredeventTypestringrequiredEvent type that fires the function. See GET /v1/functions/event-types for the supported list. The special type
cronfires on a schedule instead of a messaging event and carries acronexpression.senderIdstringRestrict the trigger to a single sender. Null means all senders in the project.
activebooleanrequiredcreatedAtstring<date-time>requiredupdatedAtstring<date-time>requiredcronstring5-field cron expression (minute hour day-of-month month day-of-week), evaluated in UTC. Present only on
crontriggers.nextRunAtstring<date-time>Next scheduled fire time. Present only on
crontriggers.lastRunAtstring<date-time>Last time the schedule fired. Null until the first fire.
400Invalid request.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
404Function not found.
codestringrequiredmessagestringrequireddetailsobject