POST from NHI Security when something changes in your estate. Use it to open a ticket, page someone or feed a SIEM without polling the API.
Add an endpoint
In the console, open Settings and use the Webhooks panel. Adding, deleting and testing an endpoint needsorganization:update; seeing endpoints and their delivery log needs organization:read. An organization can have up to 10 endpoints.
The same through the API:
whsec_…). The secret is returned once and never again; copy it into your receiver’s configuration. You can pass your own secret (32 to 256 characters) instead of having one generated. It is stored encrypted with the deployment’s credential encryption key and is not readable through any API.
The URL must use https, port 443, 6443 or 8443, carry no user name, password or token, and name a public host. NHI Security refuses private, loopback, link-local and metadata addresses when you add the endpoint, and again on every delivery against every address the host name resolves to, so a DNS record pointing at an internal address is refused at send time. Redirects are not followed.
Adding, deleting and testing are recorded in the audit trail as
webhook.created, webhook.deleted and webhook.test_sent.
Events
Every delivery body has the same envelope:id is the event’s own identifier and is the same for every endpoint that receives it, so a receiver can drop duplicates on it.
An event is queued in the same database transaction as the change it reports, so a change that rolls back sends nothing and a committed one is not lost if the process stops before sending. No event carries credential material, evidence or raw provider output.
Verify a delivery
Each request carries four headers:HMAC-SHA256, keyed with the endpoint’s secret, over exactly:
X-Webhook-… header names. In Node:
Delivery and retries
Any2xx answer within 10 seconds counts as delivered. Anything else, including a timeout, a refused address or a redirect, is a failed attempt. Failed deliveries are retried after 30 seconds, then with the wait doubling up to two hours, for 12 attempts in all (about eight hours); after that the delivery is marked failed. The delivery log on Settings → Webhooks shows each delivery’s event, status, attempts and the last answer (HTTP status or error).
Deliveries are sent by an in-process worker every 30 seconds, which runs only when DISCOVERY_SCHEDULER_ENABLED is on (the default when APP_ENV=production; see Configuration). With it off, events still queue and show as pending; Send test always sends at once.
Limits
- Every endpoint receives every event type. Filter on
typein your receiver. - A secret cannot be rotated in place. Add a second endpoint with a new secret, move your receiver over, then delete the old one.
- Rotating the deployment’s credential encryption key does not re-encrypt webhook secrets. Keep the old key listed in
CREDENTIAL_ENCRYPTION_RETIRED_KEYSuntil every endpoint has been recreated. - Deliveries are not ordered: a retry can arrive after a later event. Use
occurredAtto order them.