Overview
Creates a new automation trigger. When the specified event type occurs and all conditions are met, the configured action fires automatically. Emits a trigger.created event on the EventBus.
Required role: admin
JWT Bearer token. Format: Bearer <your-jwt>.
Request body
A descriptive name for the trigger. Example: Auto-investigate critical incidents.
The EventBus event that activates this trigger. One of the 20 supported events (e.g. incident.created, remediation.proposed).
Optional filter conditions. Only events matching all conditions fire the trigger. Supported keys vary by event type — for incident.created: severity (array), source (automated | manual).
Action to execute. Supported actions: start_investigation, notify_channel, run_skill, create_ticket.
Configuration for the action. For run_skill: { "skillId": "skl_..." }. For notify_channel: { "channelId": "..." }.
Response
Returns 201 Created.
{
"triggerId": "trg_01HX9VTPQR3KF8MZWBYD5N6JCE",
"name": "Auto-investigate critical incidents",
"eventType": "incident.created",
"conditions": { "severity": ["critical", "high"] },
"action": "start_investigation",
"enabled": true,
"createdAt": "2024-04-01T10:00:00Z"
}
Error responses
| Status | Error code | Description |
|---|
400 | validation_error | Required fields missing or invalid |
401 | unauthorized | Missing or invalid JWT |
403 | forbidden | Caller lacks admin role |
409 | trigger_limit_reached | Tenant has reached the maximum number of triggers for the current plan |
Examples
curl https://api.causeflow.ai/v1/triggers \
-X POST \
-H "Authorization: Bearer eyJhbGc..." \
-H "Content-Type: application/json" \
-d '{
"name": "Auto-investigate critical incidents",
"eventType": "incident.created",
"conditions": { "severity": ["critical", "high"] },
"action": "start_investigation"
}'
List triggers
View all configured triggers
Delete trigger
Remove a trigger