Webhooks
Managing endpoints via the API
This guide is for integrations that register and maintain their own webhook endpoints through the REST API instead of asking the operator to set them up in the portal. Endpoints belong to the organization, not to a site, so the paths have no site prefix.
Before you start
Section titled “Before you start”- The token needs
webhook_endpoints:writeto change endpoints andwebhook_endpoints:readto list them and read deliveries. - An endpoint belongs to the integration that created it. You see only your own, even if other integrations serve the same operator. Endpoints the operator created in the portal are not visible through the API.
- Build and test your receiver first, see Receiving webhooks.
Register an endpoint
Section titled “Register an endpoint”-
Send
POST /webhook_endpoints:{"url": "https://booking.example/hooks/sedisto","description": "Booking sync","event_types": ["access.granted", "access.denied"],"subscriptions": { "site": ["5b1d6c2e-…"] },"contact_email": "ops@booking.example"} -
Store
signing_secretfrom the201response at once. It is never returned again.
Only url is required, and it must be HTTPS on a publicly reachable host. An empty event_types list means all types; the Webhook event catalogue lists them. contact_email is notified when the endpoint’s health changes.
Subscription filters
Section titled “Subscription filters”subscriptions restricts the endpoint to what an event concerns, on four axes: site, entrance, unit and account, each with a list of ids. At most ten ids in total across all axes. Type filter and subscription filter combine: an endpoint for access.denied restricted to one site receives denied decisions at that site and nothing else.
An event that names none of the restricted records is not delivered. If you restrict an endpoint to a unit, events that concern no unit stop arriving.
An integration restricted to some sites may subscribe only within those sites, and not by account at all, because one account can hold access at several sites. Violations are refused with 422.
Maintain an endpoint
Section titled “Maintain an endpoint”| Request | Effect |
|---|---|
GET /webhook_endpoints |
Your endpoints, oldest first, paginated. |
GET /webhook_endpoints/{id} |
One endpoint with health_state (healthy, failing or disabled) and last_failure_at. The secret is not included. |
PUT /webhook_endpoints/{id} |
Changes url, description, event_types, subscriptions or contact_email. Fields you leave out keep their value. |
DELETE /webhook_endpoints/{id} |
Stops delivery immediately. Queued messages are dropped. |
POST /webhook_endpoints/{id}/rotate_secret |
Returns a new signing_secret, once. Both secrets are valid for 24 hours. |
POST /webhook_endpoints/{id}/enable |
Resumes delivery to an endpoint that was disabled after repeated failures. |
Replay missed events
Section titled “Replay missed events”POST /webhook_endpoints/{id}/recover with since and, optionally, until asks for every message in that window to be delivered again. since is inclusive, until exclusive; without until the window runs up to now. since may reach back 90 days; asking for more is refused. The call answers 202 and the replay runs asynchronously. Use it after an outage of your receiver and after re-enabling a disabled endpoint.
Read delivery attempts
Section titled “Read delivery attempts”GET /webhook_endpoints/{id}/deliveries lists recent attempts, newest first, with attempted_at, status (success, failed, pending or sending), response_code, response_duration_ms, response (the body your server returned) and trigger (scheduled or manual for a replay). A row does not name the event it carried; your receiver already knows that from the envelope.
This listing pages by cursor, not by page number. Pass limit (1 to 100, default 20). Take the X-Next-Cursor response header and send it back as cursor. When the header is absent, there are no further attempts.
Errors
Section titled “Errors”Besides the usual 400, 401, 403, 404 and 422, these requests can answer 502 when the delivery provider rejected the request and 503 when it is temporarily unavailable. Retry a 503 later.