Platform modules
Webhooks and external event delivery
Subscribe to tenant events, verify signed payloads and inspect retry attempts.
Create an event subscription
Webhooks sends tenant integration events to an external HTTP endpoint. Its API begins with /api/v1/webhooks. Create a subscription through POST /subscriptions with url, an events array and an optional signing secret.
Event matching uses the integration event's .NET type name, case-insensitively, or * for all events. For example, InvoiceIssuedIntegrationEvent is a Billing contract event. Choose the specific events your receiver understands. Global events without a tenant ID are skipped by the fan-out handler.
Subscription viewing, creation, deletion and testing use distinct Permissions.Webhooks actions: View, Create, Delete and Test. Use the current tenant's subscription IDs when querying their delivery history.
Test the receiver and inspect attempts
- Register an endpoint that you control and that the server can reach.
- Call
POST /api/v1/webhooks/subscriptions/{id}/test. - Read
GET /api/v1/webhooks/subscriptions/{id}/deliveries. - Inspect event type, attempt number, status and success, then trigger an actual subscribed business event.
The dispatcher queues a Hangfire job for each matching subscription. Each job execution creates its own delivery record, so the history describes attempts rather than just the latest result.
Verify payload signatures
When a secret is configured, the sender signs the exact UTF-8 JSON payload using HMAC-SHA256. The X-Webhook-Signature header contains sha256= followed by lowercase hexadecimal. X-Webhook-Event identifies the event type, and X-Webhook-Delivery-Id identifies the attempt record.
This Python verification core assumes your server has obtained the raw request bytes, the configured secret and the signature header:
import hashlib
import hmac
expected = "sha256=" + hmac.new(
secret.encode("utf-8"), raw_body, hashlib.sha256
).hexdigest()
valid = hmac.compare_digest(expected, signature_header)
Verify before parsing or acting on the payload. Reserializing JSON before validation changes the signed bytes. Make processing safe to repeat using the event's stable business identity; a new delivery ID can represent a retry of the same event. Secrets are protected at rest using ASP.NET Data Protection, so preserve the configured key ring during deployment changes.
Retry and destination behavior
The delivery job allows four retries after the initial attempt, with delays of 30 seconds, 2 minutes, 10 minutes and 1 hour. Network failures, 5xx, 408 and 429 are transient. Other non-success statuses stop the job retry path. Exhausted jobs remain failed in Hangfire.
The destination guard rejects loopback, private and other blocked address ranges, and checks the resolved address at connection time. Redirects are disabled. A receiver on localhost is therefore not a valid test target for this service; use a reachable controlled endpoint without weakening the guard.
Verify and troubleshoot
Test a valid signature and an altered payload. Return a controlled transient response to inspect retry records, then restore successful handling. If delivery is missing, inspect the event tenant and type name, subscription state, Hangfire and outbound networking.
If signature validation fails, compare raw body handling and secret configuration. If the receiver sees repeated events, check its idempotency logic rather than treating every attempt as a new business event. See Auditing for correlated operational investigation.