Event Rules API

Create rules that automatically trigger actions when platform events occur.

List Event Rules

GET /api/v1/event-rules
[
  {
    "id": "rule_a1b2c3d4",
    "name": "notify-on-failure",
    "event": "app.deploy.failed",
    "action": "webhook",
    "action_config": {
      "url": "https://slack.com/api/webhook/..."
    },
    "enabled": true,
    "created_at": "2024-01-15T10:30:00Z"
  }
]

Create an Event Rule

POST /api/v1/event-rules
name
string
required
Rule name
event
string
required
Event type to match
action
string
required
Action to perform: webhook, email, or pipeline
action_config
object
required
Configuration for the action
{
  "name": "auto-scale-on-high-cpu",
  "event": "droplet.metrics.cpu_high",
  "action": "webhook",
  "action_config": {
    "url": "https://example.com/auto-scale"
  }
}

Available Events

All webhook events can be used as triggers for event rules.