Edit a trigger.

PATCH/o/{org}/p/{project}/automations/{automation}/triggers/{trigger}
View .md

The kind cannot change. config is replaced whole; changing a schedule moves next_fire_at.

Authenticate with a signed-in session token (an API key cannot call this route).

Path parameters

orgstringrequired

The org's slug or id. A caller with no role in the org gets 404.

projectstringrequired

A Project's handle (name) or id, resolved inside {org} — OR the reserved sentinel _ meaning "no Project" (a direct-repo / repo-less dispatch on POST; "no Project constraint, resolve by session id alone" everywhere else). A real handle that doesn't match the session's actual Project is 404.

automationstringrequired

The automation's id.

Format uuid
triggerstringrequired

The trigger's id.

Format uuid

Request body

eventsarray of string | stringoptional
branch_patternsarray of stringoptional
configTriggerConfigoptional
15 fields
labelsarray of stringoptional

Kind github: any-of label filter. Kind linear: the labels whose addition fires linear.issue.labeled (required with it).

teamsarray of stringoptional

Kind linear: Linear team keys; empty means every public team.

statesobjectoptional

Kind linear: Linear state name -> mode (required with linear.issue.state_changed). plan starts a read-only run that posts its plan as a comment on the issue through the runner's Linear connection; exec starts an ordinary run.

authorsarray of stringoptional

Kind github: GitHub logins.

cronstringoptional

Kind schedule: a 5-field cron expression, at most hourly (every 10 minutes for a wake). Exactly one of cron and every is sent; every is stored as its cron.

everystringoptional

Kind schedule: the plain-language schedule, read in timezone (1d is midnight); stored and returned as cron. 10m and 30m need a wake (the automation's session_id).

One of10m30m1h1d
timezonestringoptional

Kind schedule: an IANA timezone; UTC when omitted.

fromarray of stringoptional

Kind email: senders that may start a run, each an address (dana@acme.com) or a domain (acme.com, @acme.com); empty means anyone. Mail from anyone else, or whose domain did not pass DMARC at Gmail, is skipped.

labelstringoptional

Kind email: a Gmail label name; only new mail carrying it fires (a Gmail filter that adds the label picks the mail). Without it, any new inbox message fires.

history_idstringoptional

Kind email: the Gmail history the trigger has read up to. An email trigger reads its runner's connected Gmail (primary account) about once a minute; each new message (sender, subject, date, the plain-text body up to 64 KB, at most 20 attachments as the run's files) starts one run, deduped on its Gmail id. Mail sent by the runner never fires. Adding one needs a Gmail connection (422 GMAIL_NOT_CONNECTED) and makes the caller its runner.

history_accountstringoptional

Kind email: the Gmail account history_id belongs to. When the runner's account changes, the trigger reads from now.

agentsarray of stringoptional

Kind session (required): the runs it follows, by saved agent id, or a harness name for runs with no saved agent. When such a run in the Project ends, the automation starts with the ended run's status, outcome, pull request, structured result and final message as its event. Its runner must be able to read that run.

endedarray of stringoptional

Kind session: the ways the run ended that fire it; [completed] when omitted.

outcomearray of stringoptional

Kind session: fire only when the run's structured result (its output_schema answer, when valid) has one of these as outcome, such as approved or changes_requested. Absent means any.

max_depthintegeroptional

Kind session: how many session triggers in a row may follow one run something else started; 3 when omitted. Runs on one pull request count together, so a review and fix loop through GitHub events ends too.

min 1max 10

Responses

200The updated trigger.
triggerAutomationTriggerrequired

An API key reads it with every null and empty field left out (events, branch_patterns, an empty config, an unset next_fire_at or last_fired_at).

10 fields
idstringrequired
Format uuid
kindstringrequired
One ofgithubschedulewebhooklinearemailsession
eventsarray of string | stringoptional

GitHub event keys (kind github) or Linear event keys (kind linear).

branch_patternsarray of stringoptional

Globs on a pull request's base branch (kind github only).

configTriggerConfigoptional
15 fields
labelsarray of stringoptional

Kind github: any-of label filter. Kind linear: the labels whose addition fires linear.issue.labeled (required with it).

teamsarray of stringoptional

Kind linear: Linear team keys; empty means every public team.

statesobjectoptional

Kind linear: Linear state name -> mode (required with linear.issue.state_changed). plan starts a read-only run that posts its plan as a comment on the issue through the runner's Linear connection; exec starts an ordinary run.

authorsarray of stringoptional

Kind github: GitHub logins.

cronstringoptional

Kind schedule: a 5-field cron expression, at most hourly (every 10 minutes for a wake). Exactly one of cron and every is sent; every is stored as its cron.

everystringoptional

Kind schedule: the plain-language schedule, read in timezone (1d is midnight); stored and returned as cron. 10m and 30m need a wake (the automation's session_id).

One of10m30m1h1d
timezonestringoptional

Kind schedule: an IANA timezone; UTC when omitted.

fromarray of stringoptional

Kind email: senders that may start a run, each an address (dana@acme.com) or a domain (acme.com, @acme.com); empty means anyone. Mail from anyone else, or whose domain did not pass DMARC at Gmail, is skipped.

labelstringoptional

Kind email: a Gmail label name; only new mail carrying it fires (a Gmail filter that adds the label picks the mail). Without it, any new inbox message fires.

history_idstringoptional

Kind email: the Gmail history the trigger has read up to. An email trigger reads its runner's connected Gmail (primary account) about once a minute; each new message (sender, subject, date, the plain-text body up to 64 KB, at most 20 attachments as the run's files) starts one run, deduped on its Gmail id. Mail sent by the runner never fires. Adding one needs a Gmail connection (422 GMAIL_NOT_CONNECTED) and makes the caller its runner.

history_accountstringoptional

Kind email: the Gmail account history_id belongs to. When the runner's account changes, the trigger reads from now.

agentsarray of stringoptional

Kind session (required): the runs it follows, by saved agent id, or a harness name for runs with no saved agent. When such a run in the Project ends, the automation starts with the ended run's status, outcome, pull request, structured result and final message as its event. Its runner must be able to read that run.

endedarray of stringoptional

Kind session: the ways the run ended that fire it; [completed] when omitted.

outcomearray of stringoptional

Kind session: fire only when the run's structured result (its output_schema answer, when valid) has one of these as outcome, such as approved or changes_requested. Absent means any.

max_depthintegeroptional

Kind session: how many session triggers in a row may follow one run something else started; 3 when omitted. Runs on one pull request count together, so a review and fix loop through GitHub events ends too.

min 1max 10
next_fire_atstring | nulloptional

The next schedule slot, or when an email trigger next reads Gmail; null for other kinds.

Format date-time
last_fired_atstring | nulloptional
Format date-time
created_atstringrequired
Format date-time
webhook_urlstringoptional

Kind webhook only: POST here with Authorization: Bearer <secret>; the body (at most 64 KB) becomes the event text and an Idempotency-Key header dedups retries. Answers 202 with a TriggerFireOutcome, and 401 for an unknown trigger or a wrong secret alike.

Format uri
webhook_secretstringoptional

Kind webhook, only in the response that created or rotated it.

400Malformed request.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
403The caller is neither the automation's creator nor an org admin (FORBIDDEN).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
404No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
422Invalid schedule (INVALID_SCHEDULE).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
429The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED).

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED). The error names the limit. Wait Retry-After seconds.

errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional