Create Trigger
Create a new trigger.
Creates a new trigger with the specified configuration. The trigger will be validated and, if it’s a cron trigger, automatically scheduled.
If channel_credentials are provided, they are stored encrypted in the secret
store under key channel_cred:{webhook_type}:{trigger_id}.
Args: payload: Trigger creation DTO (single source of truth shared with MCP toolset). user_context: Authentication context. trigger_service: Injected trigger service. secret_manager: Injected secret manager for credential storage.
Returns: The created trigger.
Raises: HTTPException: If validation fails or creation errors occur.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Payload for creating a trigger.
A trigger fires an agent — either on a cron schedule (trigger_type='cron')
or in response to an inbound webhook (trigger_type='webhook'). For poll-based
channels (e.g. email inbox), use trigger_type='polling' plus a
data_extractor configuration.
UUID of the agent to invoke when the trigger fires.
Human-readable trigger name.
1 - 255'cron' for scheduled, 'webhook' for inbound HTTP, 'polling' for extractor-driven.
cron, webhook, polling HTTP methods accepted on the webhook endpoint.
Channel credentials (bot_token, SMTP password, etc). Stored encrypted in the secret store. Never returned in responses.
Optional conditions evaluated against event data before firing.
5- or 6-field cron expression (required when trigger_type='cron').
Polling extractor identifier (e.g. 'imap', 'rss').
Connection/auth details for the polling extractor.
Short summary of what this trigger does.
1000Whether the trigger is active immediately on creation.
Event types to filter on (empty list = accept all events).
Auto-disable after this many consecutive failed executions.
1 <= x <= 100Parameters merged into the task created when the trigger fires.
IANA timezone for cron evaluation (e.g. 'UTC', 'America/New_York').
Per-channel validation rules (signature secrets, allowed senders, etc).
Channel-specific configuration (bot tokens, signing keys, etc).
Public webhook path segment. Auto-generated if omitted for webhook triggers.
Channel type: 'generic', 'telegram', 'slack', 'discord', etc.
Response
Successful Response
Response model for trigger data.