Creating Monitors
Monitors are the core resource in DiffHook. Each monitor watches one URL and fires events when content changes.
Required fields
| Field | Type | Description |
|---|---|---|
url |
string | The URL to monitor |
webhookUrl |
string | Where to send change events |
intervalMinutes |
integer | How often to check |
Valid intervals: 5, 15, 30, 60, 360, 1440 (minutes).
Optional fields
label — A human-readable name shown in the dashboard. Defaults to the URL.
cssSelector — Scope the diff to a specific DOM element. Reduces noise from nav bars, cookie banners, and other boilerplate.
{
"cssSelector": "#pricing-table"
}
jsRendering — Use a headless Chromium browser to render the page before taking a snapshot. Required for React/Vue/Angular apps that render content client-side. Slower and costs 3× credits.
Example: monitoring a pricing page
curl -X POST https://www.diffhook.com/api/monitors \
-H "Authorization: Bearer dh_live_yourkey" \
-H "Content-Type: application/json" \
-d '{
"url": "https://competitor.com/pricing",
"webhookUrl": "https://n8n.example.com/webhook/abc",
"intervalMinutes": 60,
"label": "Competitor pricing",
"cssSelector": "#pricing-table"
}'
Example: monitoring an RSS feed
RSS feeds are plain XML, so no JS rendering needed. Short intervals work well:
curl -X POST https://www.diffhook.com/api/monitors \
-H "Authorization: Bearer dh_live_yourkey" \
-H "Content-Type: application/json" \
-d '{
"url": "https://sec.gov/cgi-bin/browse-edgar?action=getcompany&company=acme",
"webhookUrl": "https://hooks.zapier.com/hooks/catch/abc",
"intervalMinutes": 15,
"label": "SEC EDGAR filings"
}'
Updating a monitor
You can update any mutable field with a PUT request. Only provided fields change:
curl -X PUT https://www.diffhook.com/api/monitors/mon_abc123 \
-H "Authorization: Bearer dh_live_yourkey" \
-H "Content-Type: application/json" \
-d '{
"intervalMinutes": 360,
"webhookUrl": "https://new-endpoint.example.com/hook"
}'
Pausing and resuming
Pausing a monitor stops polling and credit consumption. Useful for maintenance windows:
# Pause
curl -X POST https://www.diffhook.com/api/monitors/mon_abc123/pause \
-H "Authorization: Bearer dh_live_yourkey"
# Resume
curl -X POST https://www.diffhook.com/api/monitors/mon_abc123/resume \
-H "Authorization: Bearer dh_live_yourkey"