Verify webhook
jami_verify_webhookVerify webhook authenticity with timing-safe HMAC and replay protection to debug signature mismatch errors in handlers.
Instructions
Check whether a webhook delivery is genuine — the same timing-safe HMAC check and replay guard the SDK runs. Use it to debug "signature mismatch" errors in a handler.
Args:
payload: the RAW request body exactly as received (not re-serialized JSON — whitespace matters).
signature: the X-JamiDev-Signature header, "t=,v1=".
secret: the subscription's webhook secret (defaults to JAMI_WEBHOOK_SECRET).
tolerance_seconds: max age of the timestamp (default 300). Raise it to check an old captured delivery.
Returns: { valid, reason, event_type, event_id, livemode }. An invalid signature is a normal result (valid: false), not an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| secret | No | ||
| payload | Yes | Raw request body | |
| signature | Yes | X-JamiDev-Signature header value | |
| tolerance_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | ||
| reason | Yes | ||
| event_id | Yes | ||
| livemode | Yes | ||
| event_type | Yes |