webhook_sign
Generate HMAC signatures for webhook bodies to validate or test webhook receivers, including Stripe-style timestamped signatures.
Instructions
Produce an HMAC signature for a webhook body.
Useful for testing webhook receivers, generating Stripe-style
{timestamp}.{body} signatures, or signing outbound webhooks.
Args:
body: Raw request body (use exact bytes for accuracy)
secret: Webhook signing secret
algorithm: sha1 | sha256 | sha512 (default sha256)
encoding: hex | base64 | base64url (default hex)
timestamp: Optional Unix timestamp string used in the template
template: Format string with {body} and optional {timestamp}.
Stripe uses "{timestamp}.{body}".
Returns: dict with keys: signature, algorithm, encoding, signing_string
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| secret | Yes | ||
| encoding | No | hex | |
| template | No | {body} | |
| algorithm | No | sha256 | |
| timestamp | No |