Webhook Security

This guide explains how webhook signing works, how to verify requests, and how to manage secrets.

Overview

Notamify signs every webhook request with a user‑specific secret so your server can verify authenticity and integrity. The signature is sent in the X-Notamify-Signature header.

How It Works

Each webhook request includes a signature header:

X-Notamify-Signature: t=,v1=<hex_signature>[,v1=<prev_signature>]

The signature is computed as:

HMAC_SHA256(secret, ".<raw_body>")

  • timestamp is seconds since Unix epoch (UTC).

  • raw_body is the exact request body bytes.

  • secret is your webhook_secret.

Rotation behavior

When you rotate your webhook secret, Notamify includes two signatures for a short grace period (3 hours):

X-Notamify-Signature: t=...,v1=<new_sig>,v1=<prev_sig>

This lets clients verify with either secret during rollout.

chevron-rightSignature Breakdownhashtag

1) Secret (stored by client)

nmf_wh_6o2LQwqB3h1i0s4a9dC0vSg7qzV9e2JfG1kH3mN4pR5t

2) Body (raw JSON)

{"listener_id":"abc","notam":{"id":"A1234/25"},"delivered_at":"2026-02-05T12:00:00Z"}

3) Timestamp

1700000000

4) Message to sign

1700000000.{"listener_id":"abc","notam":{"id":"A1234/25"},"delivered_at":"2026-02-05T12:00:00Z"}

5) Signature (HMAC-SHA256, hex)

3b4f2a6c9f1d0c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f809

6) Header sent by Notamify

X-Notamify-Signature: t=1700000000,v1=3b4f2a6c9f1d0c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f809

7) Rotation case (grace window)

X-Notamify-Signature: t=1700000000,v1=<new_sig>,v1=<prev_sig>

Getting Your Webhook Secret

You can generate your webhook secret in Notamify API Managerarrow-up-right.

You can Rotate the webhook key anytime. After rotation, the previous key remains active for next 3 hours, or till next rotation (whatever is earlier).

Create or rotate your secret with API

You can also use dedicated endpoint to generate it.

Rotate webhook secret

post

Generates a new webhook secret for the authenticated user. The previous secret remains valid during the grace period.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
chevron-right
200

Webhook secret rotated

application/json
webhook_secretstringOptional
post
/webhook-secret:rotate

Verification Steps

  1. Read the X-Notamify-Signature header.

  2. Parse t= and all v1= values.

  3. Compute:

    expected = HMAC_SHA256(secret, ".<raw_body>")

  4. Compare expected to each v1 value.

  5. Enforce a timestamp tolerance (recommended: 10 minutes).

Python Example

JavaScript (Node.js) Example

Best Practices

  • Store the secret securely (never in client‑side code).

  • Verify signatures on every request.

  • Enforce timestamp tolerance (5–10 minutes).

  • Rotate if you suspect compromise.

Last updated