REST hooks

Let your code or your own connector subscribe a URL to one event and remove it again through the API, the way Zapier, Make and n8n do.

On this page

A REST hook is a webhook that a tool creates and removes through the API instead of someone adding it on the page. Turning a trigger on subscribes it; turning it off unsubscribes it. It's how instant triggers work in no-code tools, and how you'd build one into your own product.

Each hook carries one event type and is signed, retried and logged like any webhook. It shows on the Integrations page with the name of the key or app that created it (via Zapier, for example), and counts toward the same endpoint limit.

You need an API key with webhooks:write and the read scope of the event's app.

Subscribe

bash
curl -X POST https://www.zenhalab.com/api/integrations/v1/hooks \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event": "<event type>", "targetUrl": "https://example.com/hooks/abc"}'

The answer (201) is the hook, with its signing secret, shown this once:

json
{
  "id": "0f6e2a9c-3b1d-4c5e-8f7a-9b0c1d2e3f4a",
  "event": "<event type>",
  "app": "<app>",
  "targetUrl": "https://example.com/hooks/abc",
  "state": "active",
  "via": "My connector",
  "createdAt": "2026-10-04T12:00:00.000Z",
  "secret": "whsec_…"
}
  • event is a type from the event catalog. GET /event-types lists the ones this key may subscribe, with each one's JSON Schema and example.
  • targetUrl must be https:// and public. Tools that send it as target_url, hookUrl or url work too.
  • description (optional) is the name shown on the page; it defaults to the key's name.
  • Plan, payment and referral events (account.*) happen in more than one app: with a personal key, add "app" to say which (nehenoi, techauka or zanemotau: that app's purchases, and the referrals whose link was for it).
StatuserrorWhy
404unknown_event_typeNo such event type.
422invalid_urlNot https, private, or malformed (reason says which).
422invalid_eventThis app doesn't send that event.
422app_requiredAn account event without app.
429limit_reachedThe endpoint limit is used up (limit says how many).

Unsubscribe

bash
curl -X DELETE https://www.zenhalab.com/api/integrations/v1/hooks/<hook id> \
  -H "Authorization: Bearer $API_KEY"

204 means done; deliveries stop at once. 404 means it was already gone: treat it as done too.

A hook also goes away on its own when:

  • your receiver answers a delivery with 410 Gone (the REST Hooks convention: Zapier does it when a Zap is deleted);
  • the API key that created it is revoked, or the app that created it is disconnected.

GET /hooks lists the hooks this key created, and GET /hooks/<id> shows one. A key never sees, or removes, the hooks of another key or app, even of the same account.

Samples and polling

GET /events/<type>/sample answers the latest events of a type, exactly in the shape a hook delivers them. Tools use it to show sample data while someone sets up a trigger. With nothing real yet, it answers the catalog's example, marked "test": true.

Query
limit1 to 100 (default 3).
sinceOnly events after this instant (ISO 8601): poll with the timestamp of the last one you saw.
examplefalse to get an empty list instead of the example (what a polling trigger wants).
appFor account events, as when subscribing.

Prefer hooks to polling: they arrive the moment something happens and cost nothing while nothing does.

Verify what arrives

Deliveries to a hook are signed with its secret, exactly as described in verify webhook signatures. Keep the secret if your receiver can check it; if it can't, keep the target URL secret instead: it works like a password.

Still stuck?

Ask us. We read every message.

Privacy