A webhook receiver is the endpoint on your system that accepts event notifications sent by Xilnex Event Hub. This guide explains how to build a receiver that is secure, reliable, and fast enough to avoid retries.
It covers payload versioning, signature validation, duplicate prevention, and response timing requirements.
| Term | Description |
|---|---|
| Webhook receiver | The endpoint on your system that listens for and processes webhook calls from Xilnex Event Hub. Also called the webhook listener. |
| Shared secret | A key you configure in the Xilnex Portal when you manage the webhook configuration. Your receiver uses it to validate request signatures. |
| Signature | A hash of the request body, sent in the xilnex-webhook-signature header. It proves the call came from a trusted source. |
| HMAC SHA-256 | The hashing algorithm used to create and validate the signature. |
| Webhook job ID | An identifier sent in the xilnex-webhook-webhookjobid header. It stays the same across retries, so your receiver uses it to detect duplicate calls. |
Each webhook call from Xilnex includes the following headers that your receiver must read.
| Name | Data Type | Required | Description |
|---|---|---|---|
xilnex-webhook-signature | String (hex-encoded) | Yes | The HMAC SHA-256 hash of the raw request body, signed with the shared secret. Use it to validate the request. |
xilnex-webhook-webhookjobid | String | Yes | The webhook job identifier. A retry carries the same value as the original call, so use it as an idempotency key. |
Follow these recommendations when you build your webhook receiver.
When the structure of the webhook payload changes, create a new endpoint on your receiver. This keeps existing integrations working on the old payload structure.
Validate the request signature on every call. This confirms the webhook call originates from a trusted source.
Use HMAC with SHA-256 to hash the request body with the shared secret. Then compare the result with the xilnex-webhook-signature header value, using a secure comparison function. See Validate the Request Signature below for the steps.
A retry carries the same xilnex-webhook-webhookjobid as the original call. Treat it as an idempotency key and check it on every call.
| Requirement | Detail |
|---|---|
| Initial response | Respond to each webhook call within 10 seconds to prevent an initial timeout. |
| Retries | If the first call fails or times out, Xilnex retries up to 3 times. Each retry has a 100-second HTTP timeout. The wait between retries grows quadratically (attempt2): 1, 4, then 9 minutes. See the schedule below. |
| Processing | Process requests efficiently. Handle work asynchronously if needed, so the response is not delayed. |
| Success response | Any HTTP status code from 200 to 299 counts as a successful delivery. Any other status code counts as a failure and triggers a retry. |
Retry schedule
| Attempt | Wait Before Attempt | HTTP Timeout |
|---|---|---|
| First call | None | 10 seconds |
| Retry 1 | 1 minute | 100 seconds |
| Retry 2 | 4 minutes | 100 seconds |
| Retry 3 | 9 minutes | 100 seconds |
If the last retry also fails, Xilnex marks the webhook job as failed.
xilnex-webhook-signature request header.If the values match, the request is valid. If they do not match, return 401 Unauthorized with a minimal response body.
You configure the signature secret in the Xilnex Portal. A mismatch usually means either the Portal secret or your receiver's local verification secret is wrong or out of date. Check both, and correct whichever is wrong.
| Where You Fix the Secret | Effect on In-Flight Retries |
|---|---|
| Receiver side (local verification secret updated to match the Portal) | In-flight retries succeed. |
| Xilnex Portal (secret updated in the Portal) | In-flight retries still fail, because they carry the signature generated from the old secret. They keep retrying until the job is marked as failed. |