Change a trigger
const url = 'https://api.asklucy.eu/v1/agents/example/triggers/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"cron":"example","timezone":"example","callback_url":"https://example.com","input":"example","enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.asklucy.eu/v1/agents/example/triggers/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "cron": "example", "timezone": "example", "callback_url": "https://example.com", "input": "example", "enabled": true }'Its type can’t change. Changing a schedule’s cron or timezone recomputes next_run_at.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
At most 16 KB of JSON; null removes it.
Example generated
{ "cron": "example", "timezone": "example", "callback_url": "https://example.com", "input": "example", "enabled": true}Responses
Section titled “Responses”OK
object
Webhooks: where to POST (receiveAgentWebhook). The URL carries
the trigger’s token: it is a credential, like a Slack incoming
webhook’s. Only the agent’s managers see triggers (its owner,
or org_admins for a service agent), and they can copy it at any
time. Null for schedules.
Schedules: 5 fields (minute hour day-of-month month day-of-week), at most once every 15 minutes.
Schedules: the IANA time zone the cron is read in.
Schedules: the next time it fires; null while it or its agent is disabled. After an outage a schedule fires once, not once per missed time.
Where Lucy POSTs each run’s result when it ends (see AgentCallback). https only, to a public address.
Fixed input given to every run it starts (any JSON), next to a webhook’s payload. Null for none.
The token’s prefix and last 4 characters, to tell tokens apart.
After a rotation, until when the previous token (the previous URL) still works.
Example
{ "id": "trg_7Lp2WqZs9XcVb4Nm1KjH", "type": "webhook", "webhook_url": "https://api.asklucy.eu/v1/hooks/trg_7Lp2WqZs9XcVb4Nm1KjH/lwh_5mKq0Zp3Xw8Rt2Lv6Nb9Hc1Jd4Fg7Sa0Ye3Ui6Ok", "cron": "0 7 * * 1-5", "timezone": "Europe/Luxembourg", "secret_hint": "lwh_…x9Qa", "created_by": { "kind": "person" }}The request is invalid; errors lists what’s wrong.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
Missing, expired or invalid token.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
No such object in your organization.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.