Subscribe to webhook events
developers-webhook-subscribeOn this page
Get a token, subscribe an https URL to an event, save the signing secret, and check that deliveries arrive. Then list or remove subscriptions as you need.
Get a token, subscribe an https URL to an event, save the signing secret, and check that deliveries arrive. Then list or remove subscriptions as you need.
Who can do this: Owners and Admins with the Manage Developer Tools permission.
Before you start: an API app with the read scope for the events you want, for example read:invoices for invoice.paid. See Create an API app.
See Access tokens. The examples use
$ACCESS_TOKEN, and$SKEDULER_APIfor your Skeduler API address.It must be
https://, at a public address, up to 2048 characters. It must answer 2xx within 10 seconds. Redirects aren't followed.curl -s -X POST "$SKEDULER_API/api/v1/webhooks/subscriptions" \ -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \ -d '{"event":"invoice.paid","target_url":"https://example.com/skeduler/webhook"}'The answer includes a
signing_secret. It's shown only once. Store it with your endpoint's settings, and use it to verify every delivery.Make the event happen in Skeduler, for example record a payment that pays an invoice in full, and check your endpoint received a delivery.
When the delivery arrives, it's working. When you list your subscriptions, this one shows status active.
One subscription per event
Subscribe once for each event you want. An app can have 50 active subscriptions, and a business 200.
List and remove
- List:
GET /api/v1/webhooks/subscriptionsshows each one'sevent,target_urlandstatus(activeordisabled). - Get one:
GET /api/v1/webhooks/subscriptions/{id}. - Remove:
DELETE /api/v1/webhooks/subscriptions/{id}. Or answer a delivery with 410 Gone.
See the Webhooks API reference.
Related
In this section
- How webhooks work: subscriptions, events and deliveries
- Verify a webhook signature
- Webhook events and their payloads
- Webhook recipes: subscribe, verify and handle deliveries
- Webhook retries, duplicates and switch-off
- I'm not receiving webhook deliveries
- My webhook signature doesn't match
- My webhook subscription was disabled
- Does an integration get webhooks for its own API writes?