Skip to main content
Every delivery is signed with your webhook’s own signing secret. Check the signature before you act on a delivery, so you know it came from AeoNut and nobody changed it on the way.

How signing works

  1. AeoNut builds the full JSON body: the envelope with data inside it
  2. The JSON string is signed using HMAC-SHA256 with your webhook’s signing_secret as the key
  3. The signature is sent in the X-Webhook-Signature header, prefixed with sha256=
Each attempt is signed again, because the timestamp in the body changes on every retry.

Verification steps

1

Extract the signature header

Read the X-Webhook-Signature header from the incoming request.
2

Compute the expected signature

Calculate sha256= + HMAC-SHA256 of the raw request body using your signing secret.
3

Compare in constant time

Use a timing-safe comparison function to prevent timing attacks.

Code examples

HTTP headers

Every webhook delivery includes these headers:

Idempotency

The X-Webhook-Delivery header carries a UUID for each delivery of an event. The automatic retries of that event keep the same ID, so you can use it to skip an event you’ve already handled, for example when your server handled the event but didn’t return a 2xx in time and AeoNut tried again. A manual Resend from the delivery log is different. It sends the original event data in a fresh envelope with a new delivery ID, so it won’t match the ID you stored. If a resent event could cause you trouble, it helps to also dedupe on something in the payload, like the event type plus the resource ID in data.
In production, use a persistent store (Redis, database) for deduplication instead of an in-memory set.

Security best practices

Always verify signatures

Never process a webhook without verifying the signature first.

Use HTTPS

AeoNut also delivers to plain HTTP URLs, but only HTTPS keeps the payload private on the way to your server.

Use constant-time comparison

Avoid == or === for signature comparison. Use timingSafeEqual, hmac.compare_digest, or hash_equals.

Store secrets securely

Keep your signing secret in environment variables or a secrets manager, never in source code.