NotifyHookDocs
Receiving webhooks

Request format

Exactly what NotifyHook sends to your endpoint, so you can build a receiver for it.

Example request#

What your server receives
POST /hooks/notify HTTP/1.1
Host: example.com
Content-Type: application/json; charset=utf-8
User-Agent: NotifyHook/1.0
X-NotifyHook-Signature: 5d41c2b0d3c6f3c7b0e7a1e7f0f9a2b9c3b8e5c1d2a0f6e4b7c9d8e1f2a3b4c5
Authorization: Bearer eyJhbGciOi…

{"rule":"Bank alerts","package":"com.mybank.app","app":"My Bank","title":"Card payment","text":"€42.10 at Coffee Corner","timestamp":"2026-11-16T09:41:07.512+01:00","notificationKey":"0|com.mybank.app|7|null|10211"}

The body is your template, rendered exactly as written, including its whitespace and line breaks. It is shown on one line above to keep the example short.

Method and URL#

  • The method is always POST.
  • The URL must start with https:// and include a host. http:// URLs are rejected when you save the rule.
  • The URL is used exactly as entered. It can contain a query string, such as ?source=phone, but no placeholders.
Point at the final URL

Redirects are followed, but a 301, 302 or 303 redirect makes the client resend the request as a body-less GET. Use the final URL, with the right scheme, host and trailing slash, so the POST isn't lost.

Headers#

HeaderValue
Content-Typeapplication/json; charset=utf-8, always.
User-AgentNotifyHook/1.0. A custom User-Agent header replaces it.
X-NotifyHook-SignatureOnly when the rule has an HMAC secret. Lowercase hex HMAC-SHA256 of the body. See Verifying signatures.
Your custom headersAs configured, with variables and secrets filled in. Headers that render to an empty value are left out.

The HTTP client also adds standard headers such as Host, Content-Length and Accept-Encoding: gzip.

Body#

  • UTF-8 encoded text, exactly as rendered from the template.
  • The app doesn't check that the body is valid JSON. Invalid JSON is sent as-is, so your server may reject it with 400.
  • Every value is JSON-escaped. See Templates.

Responding#

Reply quickly with any 2xx status. The response body is ignored on success. Do slow work after you respond, or in a background job.

Your responseNotifyHook does
2xxSUCCESS
408, 429, 5xx, timeout, connection errorQUEUED and retries with backoff
Any other 4xxFAILED straight away, without retrying

For errors, NotifyHook reads up to 4096 bytes of your response, applies credential redaction and retains at most 2000 characters in the Event log. A short, readable error like {"error":"missing field 'title'"} makes debugging easier. Retryable errors become FAILED when no attempts remain; other non-success codes, such as an unfollowed redirect, fail without automatic retry. Details are in Delivery & retries.

Timeouts#

PhaseTimeout
Connect15 s
Send request20 s
Wait for response20 s

These are per-phase timeouts, not a single end-to-end deadline. The client can retry some connection failures internally. Retry-After headers are not used to schedule retries; NotifyHook uses its own backoff.

Handling duplicates#

Delivery is best effort and can repeat, not guaranteed at-least-once. If your server processed a request but the response was lost, NotifyHook may retry it. To make your receiver idempotent, include {{event.uuid}} in the template. Retries keep the same ID. Atomically claim each new ID with the work it represents; for an already processed ID, return 2xx without repeating the side effect, rather than a retryable error.

Notification updates and separate matching rules get new event IDs. A notificationKey can be reused for updates, so permanently discarding every repeated key would lose legitimate messages. Choose any cross-rule or content-based deduplication policy on your receiver. See delivery limits.

JSON
{
  "id": "{{event.uuid}}",
  "title": "{{title}}",
  "text": "{{text}}"
}

Minimal receiver#

These examples illustrate JSON parsing only; don't expose them publicly without signature verification or equivalent authentication. For Node.js, install express, save the example as receiver.mjs and run node receiver.mjs. For Python, install flask, save as receiver.py and run flask --app receiver run --port 3000. The Go example needs Go 1.22+ for method-aware routes; save as receiver.go and run go run receiver.go.

Node.js
import express from "express";

const app = express();
app.post("/hooks/notify", express.json(), (req, res) => {
  const { app: source, title, text } = req.body;
  console.log(`[${source}] ${title}: ${text}`);
  res.sendStatus(204);
});
app.listen(3000);

Your server must be reachable over HTTPS from the phone. Put it behind a TLS reverse proxy (Caddy, nginx, Cloudflare Tunnel) or deploy it to a platform that provides HTTPS. localhost in a rule refers to the phone, not your computer. Next, verify signatures so requests must prove knowledge of your signing key.