Skip to main content
POST
Create Trigger

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

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.

agent_id
string<uuid>
required

UUID of the agent to invoke when the trigger fires.

name
string
required

Human-readable trigger name.

Required string length: 1 - 255
trigger_type
enum<string>
required

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

Available options:
cron,
webhook,
polling
allowed_methods
string[]

HTTP methods accepted on the webhook endpoint.

channel_credentials
Channel Credentials · object | null

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

conditions
Conditions · object

Optional conditions evaluated against event data before firing.

cron_expression
string | null

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

data_extractor
string | null

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

data_extractor_config
Data Extractor Config · object | null

Connection/auth details for the polling extractor.

description
string
default:""

Short summary of what this trigger does.

Maximum string length: 1000
enabled
boolean
default:true

Whether the trigger is active immediately on creation.

event_types
string[]

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

failure_threshold
integer
default:5

Auto-disable after this many consecutive failed executions.

Required range: 1 <= x <= 100
task_parameters
Task Parameters · object

Parameters merged into the task created when the trigger fires.

timezone
string
default:UTC

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

validation_rules
Validation Rules · object

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

webhook_config
Webhook Config · object | null

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

webhook_id
string | null

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

webhook_type
string
default:generic

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

Response

Successful Response

Response model for trigger data.

agent_id
string<uuid>
required
conditions
Conditions · object
required
consecutive_failures
integer
required
created_at
string
required
created_by
string
required
description
string
required
failure_threshold
integer
required
id
string<uuid>
required
is_active
boolean
required
name
string
required
task_parameters
Task Parameters · object
required
trigger_type
string
required
updated_at
string
required
allowed_methods
string[] | null
cron_expression
string | null
data_extractor
string | null
event_types
string[]
has_channel_credentials
boolean
default:false
last_execution_at
string | null
next_run_time
string | null
timezone
string | null
validation_rules
Validation Rules · object | null
webhook_config
Webhook Config · object | null
webhook_id
string | null
webhook_type
string | null