Skip to content

Hooks ​

How it works ​

Create a hook in the dashboard and you get a URL like https://on.dev/h/YOUR_HOOK_KEY. Point a webhook at it, for example from Stripe, GitHub or your own service. Every request is recorded with its method, path, query, headers and body, and shows up under the hook's Requests tab.

Anything after the key is kept as the path, so one hook can take several webhooks:

text
https://on.dev/h/YOUR_HOOK_KEY/stripe
https://on.dev/h/YOUR_HOOK_KEY/github

Sending a request ​

Any method works: GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS.

bash
curl https://on.dev/h/YOUR_HOOK_KEY \
  -H "Content-Type: application/json" \
  -d '{"event": "invoice.paid", "amount": 4200}'

Requests can be up to 1 MB. The first 64 KB of the body is stored. JSON bodies are shown pretty-printed, and binary bodies are stored as base64.

Headers added by Cloudflare on the way in (cf-*, x-forwarded-*) are not stored.

Responses ​

By default a hook answers 200 with the text OK. In the hook's settings you can choose another status code, from 200 to 599, and your own response text. Use this to test how a sender handles errors and retries. The response is always plain text.

StatusMeaning
Your chosen statusThe request was recorded.
403The request came from a web browser. See below.
404No hook has this key.
413The request is larger than 1 MB.
422The body contains a card number or a password field.
429The hook received more than 60 requests in a minute, or the account reached its monthly limit.
503The hook is paused.

Replaying a request ​

Open a recorded request and enter a URL under Replay to. on.dev sends the same method, headers and body to that URL and shows the status and the start of the response. The replay adds an X-On-Replay header with the request id.

Replays go to public URLs only. Private addresses and on.dev itself are refused. Redirects are not followed.

Alerts ​

Turn on Alert on every request in a hook's settings to send each request to your alert channels. Webhook channels receive it with event: "hooks.request". Alerts are off by default, since a busy webhook can send many requests.

Servers only ​

Hooks refuse requests from web browsers, and bodies that contain card numbers or fields named like passwords. Hooks are for server-to-server webhooks, and these rules keep a hook URL from being used to collect what visitors type into a page.

Keys and pausing ​

If a hook URL leaks, choose Change key in its settings. The old URL stops working at once. A paused hook answers 503 and records nothing.

Limits ​

FreePro
Hooks325
Requests1,000 a month50,000 a month
Request history3 days30 days