v12

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01251238661.6 KB
v1
protected
triggers

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.

post/v1/triggers/

Request body

agent_idstring uuid required

UUID of the agent to invoke when the trigger fires.

allowed_methodsstring[]

HTTP methods accepted on the webhook endpoint.

channel_credentialsobject nullable

Channel credentials (bot_token, SMTP password, etc). Stored encrypted in the secret store. Never returned in responses.

conditionsobject

Optional conditions evaluated against event data before firing.

cron_expressionstring nullable

5- or 6-field cron expression (required when trigger_type='cron').

data_extractorstring nullable

Polling extractor identifier (e.g. 'imap', 'rss').

data_extractor_configobject nullable

Connection/auth details for the polling extractor.

descriptionstring

Short summary of what this trigger does.

enabledboolean

Whether the trigger is active immediately on creation.

event_typesstring[]

Event types to filter on (empty list = accept all events).

failure_thresholdinteger

Auto-disable after this many consecutive failed executions.

namestring required

Human-readable trigger name.

task_parametersobject

Parameters merged into the task created when the trigger fires.

timezonestring

IANA timezone for cron evaluation (e.g. 'UTC', 'America/New_York').

trigger_type'cron' | 'webhook' | 'polling' required

'cron' for scheduled, 'webhook' for inbound HTTP, 'polling' for extractor-driven.

validation_rulesobject

Per-channel validation rules (signature secrets, allowed senders, etc).

webhook_configobject nullable

Channel-specific configuration (bot tokens, signing keys, etc).

webhook_idstring nullable

Public webhook path segment. Auto-generated if omitted for webhook triggers.

webhook_typestring

Channel type: 'generic', 'telegram', 'slack', 'discord', etc.

Response

Successful Response

agent_idstring uuid required
allowed_methodsstring[] nullable
conditionsobject required
consecutive_failuresinteger required
created_atstring required
created_bystring required
cron_expressionstring nullable
data_extractorstring nullable
descriptionstring required
event_typesstring[]
failure_thresholdinteger required
has_channel_credentialsboolean
idstring uuid required
is_activeboolean required
last_execution_atstring nullable
namestring required
next_run_timestring nullable
task_parametersobject required
timezonestring nullable
trigger_typestring required
updated_atstring required
validation_rulesobject nullable
webhook_configobject nullable
webhook_idstring nullable
webhook_typestring nullable