Webhooks

n8n, Slack, Zapier or your own server — registered once, notified with a signature you can verify.

On this page

Add an endpoint

Settings → Webhooks → Add endpoint:

  1. Name — optional, shown instead of the host.
  2. URL — http(s); localhost and LAN addresses are fine (n8n, a local relay).
  3. Events — tick what it should receive.

On save, the signing secret is shown once — copy it then; Magpie cannot show it again. Rotate secret mints a new one and the old one stops working.

Per endpoint: Send test (fires a sample so you can watch it land), Edit, Rotate secret, Pause/Resume, and delete behind a confirm. At most 10 endpoints can be registered, and two endpoints can’t share a URL. Secrets live in the OS keyring, or sealed in webhooks.json where no keyring exists — the endpoint’s badge says which.

Events

Event Fires when
watch.changed Any watch’s scheduled check finds a change
crawl.finished A crawl ends — finished or stopped
crawl.failed A crawl errors

An endpoint with no events is still reachable one way: a watch’s Send changes to setting routes that watch’s changes to it alone. That is the scalpel — one endpoint, one page — while the event subscriptions are the broad brush.

Verifying

Deliveries are Standard Webhooks with HMAC-SHA256 signatures. Verify with any Standard Webhooks library using the three headers:

  • webhook-id — stable per event
  • webhook-timestamp — when it was sent
  • webhook-signature — the HMAC of "{id}.{timestamp}.{body}" with your signing secret

A verified signature means the payload left this machine’s Magpie untouched. The CLI’s magpie watch --webhook is different and lesser on purpose — an unsigned JSON POST for operator-chosen endpoints (CLI reference); the signed registry is the desktop’s.

Deliveries and retries

Deliveries run while Magpie runs. Each endpoint keeps a log of its last 20 attempts — when, which event, the response status, latency, and the error verbatim when there was no response. A failed delivery retries 3 times after its first attempt — first wait 2 s, tripling per retry, capped at 30 s between tries — then waits for the next event. The log row records how many attempts one message took.

The log also carries Send test’s deliveries, under the event name webhook.test — a test fires at its endpoint alone, whatever it subscribes to, in a single attempt so the button answers fast.

A receiver that answers 410 Gone pauses the endpoint by itself — Standard Webhooks etiquette for “stop sending”. Nothing is deleted: the secret and the log survive, and Resume turns it back on.

Pausing an endpoint stops deliveries without deleting it or its secret — the log keeps its history. Watches whose checks fire while the app is closed run at the next launch; for round-the-clock delivery, keep the app in the tray (Background).

v1.0.0-rc.4 · updated