Every webhook delivery from KeyPort includes a signed JSON payload. You should verify the signature before trusting or processing the payload.
Always verify the X-KeyPort-Signature header before processing a webhook payload. Skipping verification exposes your endpoint to spoofed requests from unauthorized sources.
KeyPort includes the following HTTP headers with every delivery:
Payload structure
The request body is a JSON object with the following shape:
Verifying the signature
The X-KeyPort-Signature header contains an HMAC-SHA256 signature. To verify it, concatenate the X-KeyPort-Timestamp value, a literal ., and the raw request body, then compute the HMAC using your whsec_... signing secret.
Pass the raw request body string — not a parsed JSON object — to the function. Parsing and re-serializing the body can change whitespace or key order and cause the signature check to fail.