{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Validation is synchronous, so a mistake is a 400/409 at creation, not a silent miss at the first\nfire. Exactly one of `webhook` / `cron` must be present and match `kind`. kind=cron forbids a\n`webhook` block and requires a parseable `cron.cron_expr` and a valid IANA `cron.timezone`.\nsession_mode=fresh requires `session_template` (a well-formed agents.yaml Agent manifest) and\nforbids `bound_session_id`; session_mode=reuse requires `bound_session_id` (an existing team-owned\nsession) and forbids `session_template`. `output.mode` selects the destination block (email/slack),\nwhich is stored encrypted. `name` must be unique per team among non-deleted triggers.\n\nFor webhook triggers the response includes `webhook_secret` exactly ONCE - it is never returned\nagain. Cron triggers return no secret and carry a computed `trigger.cron.next_run_at`. The team and\nuser identity are taken from the authenticated principal, never the body.","properties":{"body":{"$ref":"#/definitions/create_trigger_request"}},"required":["body"],"additionalProperties":false,"definitions":{"create_trigger_request":{"type":"object","description":"See the CreateTrigger operation description for the conditional-requirement matrix. team_id is NOT accepted here - it is derived from the authenticated principal.","required":["kind","name","session_mode","prompt_template","output"],"properties":{"kind":{"$ref":"#/definitions/trigger_kind"},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9]([A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$","description":"Team-unique (among non-deleted triggers) trigger name. Same rules as session names; not UUID-form.","examples":["nightly-deploy-check"]},"session_mode":{"$ref":"#/definitions/trigger_session_mode"},"prompt_template":{"type":"string","description":"The prompt sent on each fire. For cron it must not contain payload-interpolation placeholders.","examples":["Review the latest push and summarize risks."]},"output":{"$ref":"#/definitions/trigger_output_write"},"session_template":{"type":"string","description":"fresh only. Full agents.yaml Agent manifest (YAML or JSON). Any embedded env values are split out and encrypted server-side.","examples":[""]},"bound_session_id":{"type":"string","format":"uuid","description":"reuse only. UUID of an existing session owned by the team.","examples":["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]},"webhook":{"$ref":"#/definitions/create_webhook_config"},"cron":{"$ref":"#/definitions/create_cron_config"}}},"trigger_kind":{"type":"string","enum":["webhook","cron"],"description":"How the trigger fires - on an event (webhook) or on a schedule (cron). Immutable after create.","examples":["webhook"]},"trigger_session_mode":{"type":"string","enum":["fresh","reuse"],"description":"fresh = a new session is created from the trigger's spec on every firing and destroyed after. reuse = the trigger binds an existing PAUSED session, resumed on each firing and paused after; multiple triggers may bind one session.","examples":["fresh"]},"trigger_output_write":{"type":"object","description":"Output-delivery configuration on create/update. Exactly one of email / slack is required for the matching mode and forbidden otherwise; destinations are stored encrypted and never returned.","required":["mode"],"properties":{"mode":{"$ref":"#/definitions/trigger_output_mode"},"email":{"type":"string","description":"Destination address; required iff mode=email.","examples":["oncall@example.com"]},"slack":{"$ref":"#/definitions/slack_output_write"}}},"create_webhook_config":{"type":"object","description":"webhook block on create. Omitting provider defaults to custom.","properties":{"provider":{"$ref":"#/definitions/webhook_provider_key"}}},"create_cron_config":{"type":"object","description":"cron block on create.","required":["cron_expr","timezone"],"properties":{"cron_expr":{"type":"string","examples":["0 9 * * 1-5"]},"timezone":{"type":"string","description":"IANA timezone.","examples":["America/New_York"]}}},"trigger_output_mode":{"type":"string","enum":["none","email","slack"],"description":"none = nothing pushed; the result stays in run history for self-serve. email = the collected run output is emailed to a configured address. slack = the collected run output is posted to a Slack incoming webhook URL (channel fixed by the webhook at install time).","examples":["email"]},"slack_output_write":{"type":"object","description":"Slack destination on create/update. webhook_url is required when mode=slack; must be https://hooks.slack.com/services/...; stored encrypted and never returned.","required":["webhook_url"],"properties":{"webhook_url":{"type":"string","description":"Slack incoming webhook URL (https://hooks.slack.com/services/...). The channel is bound to this URL at install time.","examples":["https://hooks.slack.com/services/T0000/B0000/XXXX"]}}},"webhook_provider_key":{"type":"string","enum":["github","gitlab","custom"],"description":"Signature-verification scheme applied to a delivery. Omitted on create defaults to custom.","examples":["github"]}}},"name":"CreateTrigger creates a webhook or cron trigger.","id":"digitalocean.harness_create_trigger","example":{"body":{"kind":"webhook","name":"nightly-deploy-check","session_mode":"fresh","prompt_template":"Review the latest push and summarize risks.","output":{"mode":"email"}}},"maxRequests":1,"summary":false}}