Skip to main content
POST
/
v1
/
triggers
Create trigger
curl --request POST \
  --url https://api.example.com/v1/triggers \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "eventType": "<string>",
  "conditions": {},
  "action": "<string>",
  "actionConfig": {}
}
'

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

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <your-jwt>.

Request body

name
string
required
A descriptive name for the trigger. Example: Auto-investigate critical incidents.
eventType
string
required
The EventBus event that activates this trigger. One of the 20 supported events (e.g. incident.created, remediation.proposed).
conditions
object
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
string
required
Action to execute. Supported actions: start_investigation, notify_channel, run_skill, create_ticket.
actionConfig
object
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

StatusError codeDescription
400validation_errorRequired fields missing or invalid
401unauthorizedMissing or invalid JWT
403forbiddenCaller lacks admin role
409trigger_limit_reachedTenant 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