SigSentrySigSentry
Watchdog

POST /v1/config/monitoring

Create a watchdog rule that monitors logs and either notifies or auto-analyzes when it trips

Creates a new watchdog rule on the current project. New rules default to disabled — flip isEnabled to true in the request, or update the rule later, before checks begin. The project-wide master switch lives in the dashboard at Project → Watchdog → Settings.

Authentication

API key with config:write permission. Project-scoped or tenant-scoped (with X-Project-Id).

Endpoint

POST /v1/config/monitoring

Request body

FieldTypeRequiredNotes
namestring (1–255 chars)Human-readable name shown in the dashboard and alerts
ruleType'error_count' | 'error_rate' | 'pattern' | 'spike'What the rule watches for — see Rule types
intervalMode'fixed' | 'random'fixed runs at a steady cadence; random spreads checks across the day around an average — see Scheduling
intervalMinutesint 1–1440How often to check, in minutes. Default: 15
avgChecksPerDayint 1–288 | nullUsed when intervalMode is random to set the average daily check count
lookbackMinutesint 1–1440How far back each check looks. Default: 30
errorCountThresholdint ≥ 1 | nullRequired when ruleType is error_count. Trips when the lookback window contains at least this many errors
errorRateThresholdnumber 0–1 | nullRequired when ruleType is error_rate. Fraction of total logs that are errors (e.g. 0.05 = 5%)
minErrorCountint ≥ 1Floor for error_rate and spike rules — prevents alerts on tiny samples. Default: 5
patternsarray<{ label, regex }>Required when ruleType is pattern. Each entry's regex is matched against log lines; label shows up in the alert
spikeMultipliernumber ≥ 1Used when ruleType is spike. Trips when the current window's error count is at least this multiple of the recent baseline. Default: 3.0
action'notify_only' | 'auto_analyze'notify_only posts an alert to channels; auto_analyze also kicks off a full analysis. Default: notify_only
cooldownMinutesint ≥ 0Minimum minutes between two firings of this rule. Default: 30
dailyAlertCapint ≥ 0Max alerts per day across the whole project. Default: 10
channelOverrideIdsstring[] (UUIDs) | nullNotification channels to use for this rule's alerts. null falls back to the project default
isEnabledbooleanWhether the rule starts running on creation. Default: false
{
  "name": "Checkout error spike",
  "ruleType": "spike",
  "intervalMode": "fixed",
  "intervalMinutes": 15,
  "lookbackMinutes": 30,
  "minErrorCount": 5,
  "spikeMultiplier": 3.0,
  "action": "auto_analyze",
  "cooldownMinutes": 30,
  "dailyAlertCap": 10,
  "isEnabled": true
}

For a pattern rule:

{
  "name": "Database connection errors",
  "ruleType": "pattern",
  "intervalMode": "fixed",
  "intervalMinutes": 5,
  "lookbackMinutes": 10,
  "patterns": [
    { "label": "pool exhausted", "regex": "connection pool.*exhausted" },
    { "label": "timeout", "regex": "ETIMEDOUT" }
  ],
  "action": "auto_analyze",
  "isEnabled": true
}

Response

201 Created

{
  "success": true,
  "data": {
    "id": "wdg_a1b2c3..."
  }
}
FieldTypeNotes
idstringThe rule id — use it to update, delete, or read activity for this rule

Error responses

Statuserror.codeWhen
400VALIDATION_ERRORA field failed validation (invalid ruleType, malformed regex in patterns, out-of-range numbers, etc.)
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENKey lacks config:write
403QUOTA_EXCEEDEDPlan's per-project rule quota reached

Example

curl -X POST https://api.sigsentry.com/v1/config/monitoring \
  -H "Authorization: Bearer ss_secret_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Checkout error spike",
    "ruleType": "spike",
    "intervalMode": "fixed",
    "intervalMinutes": 15,
    "spikeMultiplier": 3.0,
    "action": "auto_analyze",
    "isEnabled": true
  }'

Estimating cost before enabling

A rule with action: auto_analyze consumes an analysis from your plan quota every time it trips. Use POST /v1/config/monitoring/dry-run to replay the same configuration against the last seven days of logs and see how often it would have fired. The Cost calculator walks through sizing.