/v2/agents/triggersCreateTrigger creates a webhook or cron trigger.
Validation is synchronous, so a mistake is a 400/409 at creation, not a silent miss at the first
fire. Exactly one of webhook / cron must be present and match kind. kind=cron forbids a
webhook block and requires a parseable cron.cron_expr and a valid IANA cron.timezone.
session_mode=fresh requires session_template (a well-formed agents.yaml Agent manifest) and
forbids bound_session_id; session_mode=reuse requires bound_session_id (an existing team-owned
session) and forbids session_template. output.mode selects the destination block (email/slack),
which is stored encrypted. name must be unique per team among non-deleted triggers.
For webhook triggers the response includes webhook_secret exactly ONCE - it is never returned
again. Cron triggers return no secret and carry a computed trigger.cron.next_run_at. The team and
user identity are taken from the authenticated principal, never the body.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
The trigger to create.
A 400 is returned: Validation failed (bad manifest/cron/timezone, kind/block/mode mismatch, provider on cron, payload placeholder in a cron prompt, invalid email, etc.). A 401 is returned: Authentication failed due to invalid credentials. A 403 is returned: The caller is not permitted to create the backing agent config for this trigger. A 409 is returned: A non-deleted trigger with this name already exists for the team. A 422 is returned: The team's trigger limit has been reached. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. A 502 is returned: The backing agent config service returned an unexpected error. A 503 is returned: An upstream dependency needed to validate the trigger is temporarily unavailable; retry. Any other status is an error: There was an unexpected error.