Blacklist Monitor
A monitor is an IP or domain you want watched. We already see every blocklist we track change as it refreshes, and we re-check each monitor against the lists that can only be queried live. Whenever an engine starts or stops listing a monitored entry you get an alert event: emailed to the account, POSTed to a webhook you sign for, or both. Monitors cost no credits; your plan decides how many you can hold, how often they are re-checked and whether webhooks are included.
/api/monitorsfreeAPI keyCreate a monitor
How it works
- Baseline first. A new monitor is checked within a minute. What lists the entry today is recorded as its current state (and shows up under
listings) but is not alerted; nothing in it is news to you. Alerts start with the first change after that. - Two ways a change is seen. Feed-based engines report changes as their feeds refresh (
source: feed). Engines that are only reachable by live DNS query are re-checked on a schedule set by your plan (source: probe): daily on Free, every 12 hours on Starter, every 6 hours on Pro and hourly on Enterprise. Either way the event names the engine, the direction and when we saw it. - One event per engine. An entry that lands on three lists at once produces three
listedevents. Emails for events found in the same round are combined into one message; webhooks are delivered one event at a time. - Pausing stops both checks and alerts. Changes that happen while a monitor is paused are not alerted later; resuming starts from the state the lists are in then.
- Plan allowances. Your plan caps how many monitors you hold. If a plan change leaves you above the cap, the newest monitors over it are paused by the plan (
paused_by_plan: true) and stop being checked. They resume on their own once the allowance has room again, with a fresh baseline; resuming one by hand needs room too. - Delistings are confirmed. A blocklist that stops answering looks the same as one that dropped the entry, so a delisting is only recorded when consecutive checks agree. Listings are alerted on first sight.
Routes
| Route | Does |
|---|---|
| GET /api/monitors | List monitors with what currently lists each one |
| POST /api/monitors | Create a monitor (shown above) |
| GET /api/monitors/{id} | One monitor with its listings and recent events |
| POST /api/monitors/{id} | Update label, channels or paused state; omitted fields keep their value |
| DELETE /api/monitors/{id} | Delete the monitor and its events (204) |
| GET /api/monitors/events | Recent events across all monitors (?limit=1..200) |
| GET /api/monitors/{id}/events | Recent events for one monitor |
| POST /api/monitors/{id}/test | Send a signed monitor.test event to the webhook now |
| POST /api/monitors/{id}/rotate-secret | Issue a new signing secret |
Updates are plain POSTs with a partial body. Send {"webhook_url": null} to remove a webhook, {"paused": true} to pause. Adding a webhook to a monitor that had none creates a secret; fetch it with rotate-secret, since update responses never carry secrets.
An entry you already monitor is refused with 409. Private, loopback and otherwise unroutable addresses are refused with 422, since no blocklist lists them. Going past the plan's allowance, resuming a monitor when as many are active as the plan allows, or setting a webhook on a plan without them, is a 403.
Request
| Field | Type | Description |
|---|---|---|
| entry* | string | Public IP address or domain name to watch |
| entry_type | "domain" | "ip" | null | Inferred from the entry when omitted; set it to insist |
| label | string | Your name for it, e.g. the mail serverdefault "" |
| notify_email | boolean | Email the account when a listing changesdefault true |
| webhook_url | string | null | HTTPS endpoint to POST signed events to (Pro and above) |
Authenticate with API key. Send it as the X-API-Key header.
curl -X POST "https://api.senapati.io/api/monitors" \
-H "X-API-Key: $SENAPATI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"entry":"185.220.101.5","label":"outbound mail server","notify_email":true,"webhook_url":"https://hooks.example.com/senapati"}'Response
Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.
{"request_id": "7c1c7f5e-9a1f-4e4b-9c3f-2d6b8a1e5f10","timestamp": "2026-10-18T10:12:04.118320+00:00","data": {"id": "0d4f7a3e-2b1c-4e8a-9f61-5c2d8e7b3a90","entry_type": "ip","entry": "185.220.101.5","label": "outbound mail server","notify_email": true,"webhook_url": "https://hooks.example.com/senapati","paused": false,"paused_by_plan": false,"last_checked_at": null,"created_at": "2026-10-18T10:12:04.102911+00:00","listed_count": 0,"listings": [],"webhook_secret": "whsec_mJ9zq2W4gD6v1nR8kT3bY7cF0hL5pX2a"}}
webhook_secret appears in this response only. Store it; you need it to verify deliveries. Without a webhook_url it is null.
| Field | Type | Description |
|---|---|---|
| id* | string | |
| entry_type* | "domain" | "ip" | |
| entry* | string | |
| label* | string | |
| notify_email* | boolean | |
| webhook_url* | string | null | |
| paused* | boolean | |
| paused_by_plan | boolean | True when a plan change, not you, paused the monitor; it resumes by itself once the plan's allowance has room for itdefault false |
| last_checked_at* | string | null | When the monitor was last re-checked; null until the first check |
| created_at* | string | |
| listed_count* | integer | Engines listing the entry right now |
| listings* | CurrentListing[] | |
| ↳ engine_id* | string | |
| ↳ engine_name* | string | |
| ↳ engine_reference* | string | |
| ↳ listed_at* | string | |
| ↳ days_listed* | integer | |
| webhook_secret* | string | null | Signing secret for the webhook; keep it, it is not shown again |
Errors
- 401missing or invalid API key / token
- 403
- 409
- 422the request body or a parameter failed validation
- 429plan rate limit exceeded
Listing monitors
listings is the live state: every engine with an open listing for the entry, with when it was first seen there. last_checked_at is null until the baseline check has run.
{"request_id": "9b0e2c4d-6f7a-4b1e-8c2d-3e4f5a6b7c8d","timestamp": "2026-10-18T11:40:19.551204+00:00","data": [{"id": "0d4f7a3e-2b1c-4e8a-9f61-5c2d8e7b3a90","entry_type": "ip","entry": "185.220.101.5","label": "outbound mail server","notify_email": true,"webhook_url": "https://hooks.example.com/senapati","paused": false,"paused_by_plan": false,"last_checked_at": "2026-10-18T11:12:31.004512+00:00","created_at": "2026-10-18T10:12:04.102911+00:00","listed_count": 2,"listings": [{"engine_id": "86","engine_name": "Tor Exit Nodes","engine_reference": "https://check.torproject.org/torbulkexitlist","listed_at": "2026-10-18T10:12:58.330174+00:00","days_listed": 0},{"engine_id": "98","engine_name": "Spamhaus DROP","engine_reference": "https://www.spamhaus.org/drop/","listed_at": "2026-10-18T10:12:58.330174+00:00","days_listed": 0}]},{"id": "6a2e9c81-4d3b-4f7a-b1c5-0e8d7f6a5b43","entry_type": "domain","entry": "mail.example.com","label": "","notify_email": true,"webhook_url": null,"paused": false,"paused_by_plan": false,"last_checked_at": "2026-10-18T11:12:35.771003+00:00","created_at": "2026-10-18T10:15:40.918372+00:00","listed_count": 0,"listings": []}]}
| Field | Type | Description |
|---|---|---|
| id* | string | |
| entry_type* | "domain" | "ip" | |
| entry* | string | |
| label* | string | |
| notify_email* | boolean | |
| webhook_url* | string | null | |
| paused* | boolean | |
| paused_by_plan | boolean | True when a plan change, not you, paused the monitor; it resumes by itself once the plan's allowance has room for itdefault false |
| last_checked_at* | string | null | When the monitor was last re-checked; null until the first check |
| created_at* | string | |
| listed_count* | integer | Engines listing the entry right now |
| listings* | CurrentListing[] | |
| ↳ engine_id* | string | |
| ↳ engine_name* | string | |
| ↳ engine_reference* | string | |
| ↳ listed_at* | string | |
| ↳ days_listed* | integer |
| Field | Type | Description |
|---|---|---|
| engine_id* | string | |
| engine_name* | string | |
| engine_reference* | string | |
| listed_at* | string | |
| days_listed* | integer |
Alert events
Every transition is an event with its own delivery record, so you can see from the API whether a webhook reached you and what your endpoint answered.
{"request_id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f","timestamp": "2026-10-18T12:05:44.201873+00:00","data": {"events": [{"id": 418,"monitor_id": "0d4f7a3e-2b1c-4e8a-9f61-5c2d8e7b3a90","entry_type": "ip","entry": "185.220.101.5","engine_id": "9","engine_name": "Blocklist.de","event": "listed","source": "feed","occurred_at": "2026-10-18T11:58:02.447120+00:00","email_status": "delivered","webhook_status": "delivered","webhook_attempts": 1,"webhook_response_status": 200,"webhook_last_error": null},{"id": 402,"monitor_id": "0d4f7a3e-2b1c-4e8a-9f61-5c2d8e7b3a90","entry_type": "ip","entry": "185.220.101.5","engine_id": "101","engine_name": "Spamhaus ZEN","event": "delisted","source": "probe","occurred_at": "2026-10-18T11:12:31.004512+00:00","email_status": "delivered","webhook_status": "pending","webhook_attempts": 2,"webhook_response_status": 503,"webhook_last_error": "Endpoint answered HTTP 503"}]}}
| Field | Type | Description |
|---|---|---|
| id* | integer | |
| monitor_id* | string | |
| entry_type* | "domain" | "ip" | |
| entry* | string | |
| engine_id* | string | |
| engine_name* | string | |
| event* | "delisted" | "listed" | |
| source* | "feed" | "probe" | feed: seen in a feed refresh; probe: seen by the scheduled re-check |
| occurred_at* | string | |
| email_status* | "delivered" | "failed" | "pending" | "skipped" | |
| webhook_status* | "delivered" | "failed" | "pending" | "skipped" | |
| webhook_attempts* | integer | |
| webhook_response_status* | integer | null | |
| webhook_last_error* | string | null |
Webhooks
Deliveries are POSTs with a JSON body and three headers in the Standard Webhooks format, so any of its libraries can verify them. The URL must be https and resolve to a public address; redirects are not followed.
{"id": "evt_418","type": "monitor.listed","created_at": "2026-10-18T11:58:02.447120+00:00","data": {"monitor_id": "0d4f7a3e-2b1c-4e8a-9f61-5c2d8e7b3a90","label": "outbound mail server","entry_type": "ip","entry": "185.220.101.5","engine_id": "9","engine_name": "Blocklist.de","engine_reference": "https://www.blocklist.de/en/index.html","event": "listed","source": "feed","occurred_at": "2026-10-18T11:58:02.447120+00:00"}}
| Header | Value |
|---|---|
| webhook-id | The event id, evt_<n>. Retries reuse it; use it to drop duplicates. |
| webhook-timestamp | Unix seconds when the delivery was signed. |
| webhook-signature | v1,<base64 HMAC-SHA256> over {id}.{timestamp}.{body} with your secret. |
| Content-Type | application/json |
| User-Agent | Senapati-Webhooks/1.0 |
Verifying a delivery
Decode the secret after its whsec_ prefix, sign the raw body exactly as received, and compare in constant time.
import base64, hashlib, hmac, timedef verify(secret: str, headers: dict, body: bytes) -> bool:msg_id = headers["webhook-id"]ts = headers["webhook-timestamp"]if abs(time.time() - int(ts)) > 300:return False # older than five minuteskey = base64.b64decode(secret.removeprefix("whsec_"))expected = hmac.new(key, f"{msg_id}.{ts}.".encode() + body, hashlib.sha256).digest()for part in headers["webhook-signature"].split():version, _, sig = part.partition(",")if version == "v1" and hmac.compare_digest(base64.b64decode(sig), expected):return Truereturn False
Event types
| type | Meaning |
|---|---|
| monitor.listed | An engine started listing the entry. |
| monitor.delisted | An engine that listed the entry no longer does. |
| monitor.test | Sent by POST /api/monitors/{id}/test; the data block is a stand-in. |
Retries
Answer with any 2xx within ten seconds and the delivery is done. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 8 hours, then marked failed. Each event's webhook_status, webhook_attempts and the last response code are on the event, so a dead endpoint is visible from the API and the dashboard.
Email alerts
With notify_email on, the account's address gets a plain-text message per monitor per round of changes, naming each engine and direction and linking to the monitor's page. Email alerts are available on every plan.