verify_webhook_signature — Verify Webhook HMAC Signature

Statelessly verifies webhook HMAC-SHA256 signatures and replay timestamps across Stripe, GitHub, Shopify, Slack, Linear, or custom headers using constant-time Web Crypto comparison.

Why buy vs. DIY: Prevents subtle raw-body serialization bugs, hex vs. base64 mismatches, timing side channels, and Stripe/Slack timestamp replay vulnerabilities.

Pricing: $0.001 USD per stateless signature verification (x402 instant micropayment) · REST: POST https://hook-sink.apikeg.com/v1/verify-webhook-signature · MCP: https://hook-sink.apikeg.com/mcp

Input Parameters

FieldTypeRequired / DefaultDescription & Constraints
provider string Default: "auto" Webhook signature provider preset (auto, stripe, github, shopify, slack, linear, generic_sha256). (enum: auto | stripe | github | shopify | slack | linear | generic_sha256)
rawBody string Required Exact raw UTF-8 HTTP request body string as delivered by the webhook sender. (maxLength: 262144)
headers object Required HTTP request headers map containing the webhook signature header(s).
secret string Required Webhook HMAC signing secret (e.g., whsec_... for Stripe). (minLength: 1, maxLength: 512)
toleranceSeconds integer Default: 300 Timestamp replay-window tolerance in seconds for Stripe and Slack (default 300). (min: 0, max: 86400)
signatureHeader string Optional Optional custom signature header name when provider is generic_sha256 or linear. (minLength: 1, maxLength: 128)
nowSeconds integer Optional Optional Unix epoch timestamp (seconds) override for deterministic replay checks. (min: 0)

REST Example (curl)

curl -X POST "https://hook-sink.apikeg.com/v1/verify-webhook-signature" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "stripe",
  "rawBody": "{\"id\":\"evt_123\",\"type\":\"checkout.session.completed\"}",
  "headers": {
    "Stripe-Signature": "t=1700000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
  },
  "secret": "whsec_test_secret",
  "toleranceSeconds": 300
}'

MCP tools/call Payload

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "verify_webhook_signature",
    "arguments": {
      "provider": "stripe",
      "rawBody": "{\"id\":\"evt_123\",\"type\":\"checkout.session.completed\"}",
      "headers": {
        "Stripe-Signature": "t=1700000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
      },
      "secret": "whsec_test_secret",
      "toleranceSeconds": 300
    }
  }
}