Cannon VoIP Help

Check that a webhook really came from us

Every delivery is signed with your endpoint's secret. Here's how to check it.

Updated 1 week ago

Every webhook delivery carries two headers:

  • x-cannon-timestamp: when it was sent, in seconds.
  • x-cannon-signature: an HMAC-SHA256 signature, in hex.

The signature is made from the timestamp, a full stop, and the request body, using your endpoint's signing secret (shown once when you added the endpoint).

To check one

  1. Read the raw request body exactly as it arrived, before any parsing.
  2. Join the timestamp header, a full stop, and the body: timestamp.body.
  3. Compute the HMAC-SHA256 of that text with your signing secret, as hex.
  4. Compare it to x-cannon-signature using a constant-time comparison. If they differ, reject the request.

It's also wise to reject deliveries whose timestamp is more than a few minutes old.

Keep the signing secret on your server only. If you lost it, delete the endpoint and add it again to get a new one.

Was this helpful?
← All help articles