Skip to content

How do I verify a webhook signature?

Check the Sovgate-Signature header: an HMAC-SHA256 of the timestamp and the raw body, made with your signing secret.

Every delivery is signed, so you can be sure it came from Sovgate and wasn't changed.

What the header holds

The Sovgate-Signature header contains the time the delivery was signed (in seconds) and one HMAC-SHA256 signature for each active signing secret, newest first. Each signature is made over the timestamp, a full stop and the exact body.

Checking it

  1. Read the raw body exactly as received, before any parsing.
  2. Compute HMAC-SHA256 of timestamp + "." + raw body, keyed with your endpoint's signing secret.
  3. Compare your result with the signatures in the header, using a constant-time comparison.
  4. Reject the delivery if none matches, or if the timestamp is too old (a few minutes), to stop replays.

The exact header format is in the API reference.

Rolling a secret

When you roll a signing secret, you can keep the old one working for an overlap (none, 1 hour or 24 hours). During the overlap, deliveries carry a signature for each secret, so either one verifies.

The signing secret is shown only after you confirm it's you, and each reveal is recorded.

Search help articles

Find an answer in the Sovgate help center and jump straight to it.