Create a webhook
1
Create the webhook
Go to Webhooks in the console and create one. Choose its project and the event it emits, like
checkout.completed.2
Copy its URL
Reveal the webhook’s URL and copy it. It looks like
https://api.nelkap.com/webhooks/<secret>.3
Give the URL to the other service
Paste the URL in the other service’s webhook settings, as the address it calls.
4
Listen for the event
Register a workflow that listens for the webhook’s event:
nelkap/index.ts
fulfillOrder. Its payload is the call’s JSON body, exactly as the service sent it, so type it after the service’s own documentation:
nelkap/workflows/fulfill-order.ts
Test a webhook
Send a call yourself, with the body the service would send:Accepted requests
Each call must be a POST with a JSON body, up to your plan’s request size of 1 to 3 MB. Nelkap answers:
Most services call again later when they don’t get a
2xx answer.
A webhook emits its event without tags and without a
wakeOn key, so it starts runs but doesn’t wake waiting ones. To wake a run from another service’s call, receive the call in your app and emit the event yourself.Security
The secret in the URL is what proves a call is meant for your project. Treat the URL like a password:- If it leaks, rotate the webhook’s secret. The old URL stops working at once, so paste the new one in the other service right after.
- To accept calls only from the service’s servers, set the webhook’s allowed IPs: up to 20 addresses or ranges, like
203.0.113.7or203.0.113.0/24, in IPv4 or IPv6.
nelkap.emit. The order fulfillment example does this for Stripe.
Disable a webhook
Disable a webhook to stop it for a while without losing its URL. While it’s disabled, its calls get a404 and emit nothing. Enable it again, and the same URL works as before. You can also change the event a webhook emits, or its allowed IPs, at any time.
Webhook list
The Webhooks page of the console lists each webhook with its event, its project, its allowed IPs, its status, and the number of events it has emitted. The events themselves are listed with every other event, with the runs each one started. See Event history.Permissions
Your plan sets how many webhooks your workspace can have: 50, 100, or 500. See Limits.