Webhooks
A webhook channel sends urlquery's notifications to your own HTTPS endpoint as JSON: YARA matches, finished and alerted reports, watchlist and page monitor hits, rule changes, and API key changes. Use it to start a SOAR playbook, open a ticket, or feed a SIEM, without polling the API.
Set one up on urlquery.net under Settings → Notifications. The same page also sends to the browser, email, Slack, Microsoft Teams, Discord, Mattermost and Telegram; see Notifications. This page describes the generic webhook.
Set one up
- Add a channel of type Webhook with your endpoint's
https://URL. - Choose the kinds it receives (see Kinds), and for YARA matches optionally only some of your rules.
- Copy the signing secret (
whsec_…). It is shown once; make a new one on the same page if you lose it. - Send a Test notification to check that your endpoint answers.
Delivery
- The request. An HTTP
POSTwith a JSON body,Content-Type: application/json,User-Agent: urlquery-notifications/1, and the signature inX-Urlquery-Signature. - Success. Any
2xxanswer. Redirects are not followed, and a request times out after 10 seconds, so answer quickly and do slow work afterwards. - Retries. A
408,429or5xxanswer, or a connection error, is retried twice, after the answer'sRetry-Afterwhen it is at most 30 seconds. Any other answer is final. - Duplicates. A message can occasionally arrive twice, for example after a restart. Both copies have the same
id; drop the repeat. - Order. A channel's messages are sent one at a time.
- Daily limit. A channel gets at most 1,000 messages per UTC day. The next one is a
notifications.limit_reachedmessage, and nothing more is sent until 00:00 UTC. - Log. The settings page shows each channel's latest deliveries and their answers.
The body
Every message has the same envelope:
{
"id": "alert.created:<report_id>:<rule_id>",
"occurred_at": "2026-11-23T19:56:33Z",
"kind": "yara.match",
"title": "YARA rule match",
"url": "https://urlquery.net/report/<report_id>",
"fields": [
{"label": "URL", "value": "login.example.com/verify"},
{"label": "IP", "value": "192.0.2.10"},
{"label": "Severity", "value": "high"},
{"label": "Rule", "value": "Kit A login"}
],
"data": {
"report_id": "<report_id>",
"url": "login.example.com/verify",
"ip": "192.0.2.10",
"matches": [
{"rule_id": "<rule_id>", "yara_rule": "kit_a_login", "alert": "Kit A login", "severity": "high", "verdict": "phishing"}
]
}
}
| Field | Meaning |
|---|---|
id | The event behind the message. A repeated message has the same id. |
occurred_at | When the event happened, in UTC. |
kind | What happened; see Kinds. |
title, fields | A human-readable summary, the same as chat channels show. Display them; read values from data. |
url | The page the message links to, such as the report. Left out when there is none. |
data | The machine-readable details of the kind. |
URLs and IPs in a message come from analyzed pages, which are often malicious. Treat them as data: don't fetch them, and don't render them as links.
New fields may be added to the envelope and to data. Ignore fields you don't know. Fields that are unknown for an event, such as ip or a match's severity, are left out.
Kinds
| Kind | Sent when | data |
|---|---|---|
report.finished | A report you submitted finished, with or without alerts. | report_id, url, ip, alert_counts (ids, analyzer, urlquery), max_severity |
report.alerted | A report you submitted finished with alerts. | As report.finished |
yara.match | Your rule, or a rule your team shares, matched a new report. One message per rule. | report_id, url, ip, matches: rule_id, yara_rule, alert, severity, verdict |
rule.created, rule.updated, rule.deleted | A YARA rule of yours, or one shared with your team, changed. | rule_id, rule_set_id, name, change (created, updated, enabled, disabled or deleted), enabled, visibility, by_admin |
apikey.created, apikey.deleted | An API key of yours or your team's was created or deleted. The key itself is never sent. | key_id, name, owner_type (user or team), change |
monitor.indicator_seen | A new report observed an indicator of one of your watchlists. | watchlist_id, name, owner_type, report_id, url, matches: kind, value, seen_as |
monitor.page_changed | A page monitor's scan differed from its baseline. | monitor_id, name, url, owner_type, report_id, baseline_report_id, changes, final_url, new_hosts, resources: url, type, change |
notifications.test | You sent a test from the settings page. | none |
notifications.limit_reached | The channel reached its daily limit. | none |
alert_counts and max_severity count only the alerts you may see in the report. In monitor.indicator_seen, a match's seen_as says where the report observed the value: sha256, host, ip, url, final_url or request. In monitor.page_changed, changes lists redirect, http_status, new_hosts, new_resources, changed_resources, missing_resources, changed_page, certificate or new_detections.
Until November 2026, monitor.page_changed was called monitor.changed. A receiver that matched the old name must match the new one.
Verify the signature
When the channel has a secret, each request carries:
X-Urlquery-Signature: t=1795479108,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
t is the time it was signed, in Unix seconds, and v1 the hex HMAC-SHA256 of t, a dot and the raw request body, keyed with the secret. To check a request:
- Recompute the HMAC over the body exactly as received, before parsing it.
- Compare it with
v1in constant time. - Reject a
tmore than a few minutes from now, so a captured request can't be replayed later.
import hashlib
import hmac
import time
def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
try:
parts = dict(p.split("=", 1) for p in header.split(","))
t = int(parts["t"])
except (KeyError, ValueError):
return False
expected = hmac.new(secret.encode(), str(t).encode() + b"." + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", "")) and abs(time.time() - t) <= tolerance
func verify(secret, header string, body []byte, tolerance time.Duration) bool {
var t, v1 string
for _, part := range strings.Split(header, ",") {
key, value, _ := strings.Cut(part, "=")
switch key {
case "t":
t = value
case "v1":
v1 = value
}
}
seconds, err := strconv.ParseInt(t, 10, 64)
if err != nil || time.Since(time.Unix(seconds, 0)).Abs() > tolerance {
return false
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(t + "."))
mac.Write(body)
return hmac.Equal([]byte(hex.EncodeToString(mac.Sum(nil))), []byte(v1))
}
A channel without a secret is sent unsigned; make one on the settings page. A new secret replaces the old one at once, so update your endpoint when you make one.
A receiver
A minimal receiver checks the signature with verify from above, answers at once, and drops repeats by id. This one uses only Python's standard library; put it behind your HTTPS proxy.
import json
import os
from http.server import BaseHTTPRequestHandler, HTTPServer
SECRET = os.environ["URLQUERY_WEBHOOK_SECRET"]
seen: set[str] = set() # use a store with expiry in production
class Receiver(BaseHTTPRequestHandler):
def do_POST(self) -> None:
body = self.rfile.read(int(self.headers.get("Content-Length", 0)))
if not verify(SECRET, self.headers.get("X-Urlquery-Signature", ""), body):
self.send_response(401)
self.end_headers()
return
self.send_response(204) # answer first; urlquery waits at most 10 seconds
self.end_headers()
message = json.loads(body)
if message["id"] in seen:
return
seen.add(message["id"])
if message["kind"] == "yara.match":
for match in message["data"]["matches"]:
print(message["data"]["report_id"], match["alert"], match.get("severity"))
HTTPServer(("127.0.0.1", 8080), Receiver).serve_forever()
For what to do with a hit, see SOAR platforms.