Webhooks
Route a topic to a URL, verify the signature, and know why a private address is refused.
A webhook sink POSTs one JSON document to a URL whenever a message reaches a topic. It is a sink rather than a subscription because a webhook is a place, not a person — so it narrows the same way a Discord sink does (a priority floor, and allow-lists on app, tags, kinds and categories) and it retries on the same ladder as push.
Add one on a topic's Sinks tab. The URL must be https.
Verify the signature
Every delivery carries one:
X-Notify-Signature: t=1790000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bdThe signed material is <t>.<body> — the timestamp is inside the signature,
which is what makes a captured delivery un-replayable rather than merely
authentic. Verify before you trust the body: a webhook URL ends up in a CI
variable, a config file and somebody's shell history, so the URL is not a secret
and the signature is the only thing that proves a delivery came from notify.
func verify(secret, header string, body []byte) error {
var ts int64
var sig string
for _, part := range strings.Split(header, ",") {
k, v, _ := strings.Cut(part, "=")
switch k {
case "t":
ts, _ = strconv.ParseInt(v, 10, 64)
case "v1":
sig = v
}
}
// Reject anything older than a few minutes, or the signature is valid forever.
if time.Since(time.Unix(ts, 0)) > 5*time.Minute {
return errors.New("too old")
}
mac := hmac.New(sha256.New, []byte(secret))
fmt.Fprintf(mac, "%d.", ts)
mac.Write(body)
want := hex.EncodeToString(mac.Sum(nil))
// hmac.Equal, not ==: a comparison that returns early leaks where the first
// wrong byte was.
if !hmac.Equal([]byte(want), []byte(sig)) {
return errors.New("bad signature")
}
return nil
}The shape is Stripe's on purpose — if you already verify Stripe webhooks you have
this code. Read the scheme you know (v1=) rather than assuming it is the only
one present, so a future v2= alongside it does not break you.
The secret is shown exactly once, when you add the sink. There is no way to read it back, only to rotate — and rotation takes effect immediately, with no window in which both work. A window where two secrets verify is a window where a leaked one still does.
The payload
{
"id": "msg_8ba1db15ff856b0c4fbb17a9",
"topic_id": "tp_8a9278d2334745b512d83295",
"topic": "ci/builds",
"app_slug": "xmb",
"kind": "request.approved",
"title": "Your request was approved",
"body": "Dune (1984) is being sourced.",
"priority": 4,
"tags": ["requests"],
"url": "https://notify.xeonr.io/messages/msg_8ba1db15ff856b0c4fbb17a9",
"markdown": false,
"created_at": "2026-09-29T21:09:28Z",
"actions": [{ "label": "Open", "url": "https://xmb.xeonr.io/requests/3" }],
"fields": [{ "name": "Status", "value": "Approved", "inline": true }],
"colour": "#22c55e",
"attachments": [{ "filename": "poster.jpg", "content_type": "image/jpeg", "size_bytes": 184320 }],
"payload": { "title": "Dune", "year": 1984 }
}title and body are already rendered — templates run
at publish, never at send. payload is the template variables, present when the
message went through a template: a webhook is the one channel whose consumer is a
program rather than a person, so the structured event is usually more use than the
wording. Both are there, because a webhook that forwards into a chat still needs
words. fields, colour and attachments are present only when the publisher
sent them. An attachment arrives as its name, type and size, never its URL: that
is the publisher's signed link, fetched by notify and handed to nobody.
How notify reads your response
| You answer | notify does |
|---|---|
2xx | Delivered. |
429, 5xx | Retries on the backoff ladder. |
404, 410 | Marks the sink failing and stops — the endpoint is gone. |
any other 4xx | Marks the sink failing and stops. You understood and refused; retrying repeats the argument. |
| timeout, TLS failure, refused connection | Retries. |
A failing sink shows as failing on the Sinks tab with the reason, rather than retrying quietly forever.
Answer quickly and do the work afterwards. The timeout is 15 seconds, and a webhook that blocks on your own processing turns notify's retry ladder into a queue you did not want.
Why a private URL is refused
The target must resolve to a public address. Loopback, link-local
(169.254.0.0/16), private ranges, carrier NAT and their IPv6 equivalents are all
refused — including ::ffff: mapped spellings.
This is not tidiness. An unguarded webhook feature turns notify into a proxy for
reaching anything it can see and you cannot: the cloud metadata endpoint at
169.254.169.254, a database on 10.x, another service on localhost. So:
- the check happens when you add the sink, for a useful error message;
- and again on the connection, against the address actually dialled, because a hostname can resolve into a private range after the first check passes;
- redirects are not followed at all. A
302to the metadata endpoint is the cheapest way past a check made before the request, so a webhook URL has to be the final destination.
If you need to receive on a private network, put something public in front of it. That is your trust boundary to make, not one notify can make for you.