Unsparing Docs

Automations

Automate incident response with triggers and actions. Auto-remediate common issues and reduce alert fatigue.

How Automations Work

Automations in Unsparing follow a simple pattern:

When [trigger] → Do [action]

When a monitor fails, Unsparing can automatically take action — no manual intervention needed.

Triggers

TriggerDescription
Monitor failsAny monitor check fails
Monitor recoversA previously failed monitor recovers
SSL expiringCertificate within N days of expiry
DNS changedDNS record value changes
Cron missedCron job doesn't fire on schedule
Response slowResponse time exceeds threshold
Severity changesAlert severity escalates

Actions

ActionDescription
Send notificationEmail, Slack, or webhook
Pause monitorStop checking temporarily
Resume monitorResume a paused monitor
Call webhookPOST to an external URL
Create investigationOpen an investigation timeline
Run scriptExecute a custom script via webhook

Setting Up an Automation

  1. Go to Automations → Rules and click Create Rule
  2. Select a trigger
  3. Configure the trigger conditions
  4. Select one or more actions
  5. Save

Example: Auto-Pause During Maintenance

Trigger: SSL expiring in 30 days Action: Send Slack notification + Create investigation

When SSL certificate on *.example.com expires in < 30 days:
  1. Send Slack message to #infra-alerts
  2. Create investigation "SSL renewal needed for example.com"

Example: Auto-Remediate Down Service

Trigger: Uptime monitor fails Action: Call webhook (trigger restart script)

When uptime monitor "Production API" goes down:
  1. Call webhook https://api.example.com/restart/api
  2. Wait 60 seconds
  3. If still down, send Slack to #oncall

Automation Templates

Unsparing includes pre-built templates:

SSL Renewal Reminder

  • Trigger: SSL certificate expiring in 14 days
  • Action: Send email + Slack notification + create investigation

DNS Change Alert

  • Trigger: Any DNS record changes
  • Action: Send Slack to #security + create investigation

Cron Job Failure Escalation

  • Trigger: Cron job missed
  • Action: Send email to on-call + escalate after 5 minutes

Auto-Recovery

  • Trigger: Uptime monitor recovers
  • Action: Send Slack to #monitoring + close investigation

Automation Logs

Every automation execution is logged with:

  • Timestamp — When the automation ran
  • Trigger — What event caused it
  • Actions taken — What the automation did
  • Result — Success or failure for each action
  • Duration — How long the automation took

View logs at Automations → Logs.

API Endpoints

List Automations

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.unsparing.dev/api/v1/automations

Create an Automation

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SSL Renewal Reminder",
    "trigger": {
      "type": "ssl.expiring",
      "conditions": {
        "days": 14
      }
    },
    "actions": [
      {"type": "notification.slack", "channel": "#infra-alerts"},
      {"type": "investigation.create", "title": "SSL renewal needed"}
    ]
  }' \
  https://api.unsparing.dev/api/v1/automations

Alerts & Notifications · API Reference

On this page