Skip to main content

Webhook Signature Verification

Every Amps webhook carries a Svix signature header. Verify it before processing the payload to confirm the request originated from Amps and has not been tampered with.
Never process webhooks without verifying signatures. Unverified webhooks could be malicious requests.

Signature Header

Every webhook carries three Svix headers, and signature verification uses all three:
svix-signature is a space-separated list of v1,<base64> signatures (a second entry appears briefly after a secret rotation, so a valid request matches any one of them). svix-timestamp is the Unix second the message was signed, used for replay protection. The scheme is the standard Svix HMAC SHA-256.

Verifying Signatures

The easiest way to verify webhooks is using the Svix SDK:

Manual Verification

If your language has no Svix SDK, replicate the scheme by hand. The signed content is {svix-id}.{svix-timestamp}.{rawBody}, the HMAC key is the base64 body of your whsec_... secret, and the result is a base64-encoded HMAC SHA-256 digest:

Getting Your Webhook Secret

Your webhook secret is available in the Amps AI Dashboard:
  1. Navigate to Webhooks settings
  2. Select your webhook endpoint
  3. Copy the webhook secret
  4. Store it securely (environment variable, secret manager)
Never commit your webhook secret to version control. Store it securely and rotate it if exposed.

Security Best Practices

Every webhook request must be verified before processing. Reject any request without a valid signature.
Verify that webhook timestamps are recent (within 5 minutes) to prevent replay attacks.
Always use HTTPS endpoints for webhooks. Never accept webhooks over HTTP in production.
Use environment variables or secret management services. Never hardcode secrets.
Use the svix-id header to prevent processing duplicate webhooks. Store processed delivery IDs.
Implement rate limiting on your webhook endpoint to prevent abuse.

Example Implementation

Node.js/Express

Python/Flask

Testing Webhook Verification

Local Testing

Use tools like ngrok to expose your local endpoint:
Then configure the ngrok URL in your dashboard for testing.

Signature Testing

Test your verification logic with known good signatures before going to production.

Troubleshooting

Check that:
  • You’re using the correct webhook secret
  • The payload hasn’t been modified (use raw body parser)
  • The signature header is being read correctly
  • Timestamps are within the acceptable window
Implement idempotency checking using the svix-id header. Store processed delivery IDs and skip duplicates.
Ensure your endpoint responds within 30 seconds. Process webhooks asynchronously if needed.

Next Steps

Webhook Types

See all webhook event types

Webhook Overview

Learn about webhook setup