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.
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
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:
{
"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_…"
}eventis a type from the event catalog.GET /event-typeslists the ones this key may subscribe, with each one's JSON Schema and example.targetUrlmust behttps://and public. Tools that send it astarget_url,hookUrlorurlwork 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,techaukaorzanemotau: that app's purchases, and the referrals whose link was for it).
| Status | error | Why |
|---|---|---|
404 | unknown_event_type | No such event type. |
422 | invalid_url | Not https, private, or malformed (reason says which). |
422 | invalid_event | This app doesn't send that event. |
422 | app_required | An account event without app. |
429 | limit_reached | The endpoint limit is used up (limit says how many). |
Unsubscribe
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 | |
|---|---|
limit | 1 to 100 (default 3). |
since | Only events after this instant (ISO 8601): poll with the timestamp of the last one you saw. |
example | false to get an empty list instead of the example (what a polling trigger wants). |
app | For 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.