Hookbase
Docs
GuideAPI ReferenceIntegrationsUse CasesCLIMCP
Getting StartedSDK ReferencePortal ComponentsAPI Reference
Get Started

API Reference

OverviewAPI ExplorerAuthenticationAPI Keys

Core Endpoints

SourcesDestinationsRoutesEventsDeliveriesDelivery ClustersTransformsFiltersSchemasWebhook IngestAnalytics

Development Tools

TunnelsCron JobsCron GroupsScheduled Sends

Administration

Custom DomainsAudit LogsNotification ChannelsAlert RulesRedaction PoliciesObservability Export
DocsReceiveAPIAlert Rules

Alert Rules API

Alert rules watch your traffic and notify one or more notification channels when a condition fires.

Endpoints

MethodPathDescription
GET/api/alert-rulesList alert rules
GET/api/alert-rules/{id}Get an alert rule
POST/api/alert-rulesCreate an alert rule
PATCH/api/alert-rules/{id}Update an alert rule
POST/api/alert-rules/{id}/testSend a test notification
DELETE/api/alert-rules/{id}Delete an alert rule

Trigger Types

Each rule has a triggerType and a matching triggerConfig:

TriggerFires whenKey config
source_silenceA source receives no events for a periodsourceId?, silenceMinutes (1–1440)
failure_rateDelivery failure % exceeds a thresholddestinationId?, thresholdPercent (1–100), windowMinutes (5–1440)
latency_thresholdAverage delivery latency exceeds a thresholddestinationId?, thresholdMs (100–300000), windowMinutes (5–1440)
volume_spikeEvent volume exceeds a maxsourceId?, maxEvents, windowMinutes (1–1440)
volume_dropEvent volume drops below a minsourceId?, minEvents, windowMinutes (5–1440)
anomaly_volumeVolume deviates from its baseline (z-score)sourceId, direction (spike/drop/both), zThreshold (2–10), windowMinutes (10–360)
schema_driftA source payload schema changessourceId, alertOn.{addedFields,removedFields,typeChanges}

Omitting sourceId/destinationId (where optional) applies the rule across all sources/destinations.

Alert Rule Object

{
  "id": "alr_abc123",
  "name": "Prod API failure rate",
  "triggerType": "failure_rate",
  "triggerConfig": {
    "type": "failure_rate",
    "destinationId": "dst_api123",
    "thresholdPercent": 25,
    "windowMinutes": 15
  },
  "notificationChannels": ["nch_slack1"],
  "channelConfig": { "cooldownMinutes": 30 },
  "isActive": true,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Create Alert Rule

POST /api/alert-rules

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name (1–100 chars)
triggerTypestringYesOne of the trigger types above
triggerConfigobjectYesConfig for the trigger (its type must match triggerType)
notificationChannelsstring[]YesNotification channel IDs (at least one)
cooldownMinutesnumberNoMinimum minutes between alerts (1–1440, default 30)

Example

curl -X POST https://api.hookbase.app/api/alert-rules \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Prod API failure rate",
    "triggerType": "failure_rate",
    "triggerConfig": {
      "type": "failure_rate",
      "destinationId": "dst_api123",
      "thresholdPercent": 25,
      "windowMinutes": 15
    },
    "notificationChannels": ["nch_slack1"],
    "cooldownMinutes": 30
  }'

Update Alert Rule

PATCH /api/alert-rules/{id}

All fields optional: name, triggerConfig, notificationChannels, cooldownMinutes, isActive.

Test Alert Rule

Send a test notification to the rule's channels to confirm they're wired up correctly.

POST /api/alert-rules/{id}/test

Info

Some triggers (e.g. anomaly_volume, schema_drift) require a higher plan tier. Creating a rule with a gated trigger returns 403.

PreviousNotification ChannelsNextRedaction Policies

On this page

EndpointsTrigger TypesAlert Rule ObjectCreate Alert RuleRequest BodyExampleUpdate Alert RuleTest Alert Rule