validate_webhook_signature
validate_webhook_signature
validate_webhook_signature
Verify that an incoming webhook was signed by SignalWire with your Signing Key. This is
the primary standalone validator for custom (non-AgentBase) servers. Pass it the raw,
unparsed request body so the signature matches what the platform computed.
The signature value comes from the X-SignalWire-Signature request header (or
X-Twilio-Signature for Compatibility callbacks). See the
security overview for the recognized header names.
Your Signing Key from the Dashboard, as a UTF-8 string. A None or empty value raises
ValueError — this is a programming error, not a validation failure.
The X-SignalWire-Signature header value (or X-Twilio-Signature for Compatibility
callbacks). A missing or empty value returns False without raising.
The full URL SignalWire POSTed to — scheme, host, optional port, path, and query. It must match what the platform saw.
The raw request body as a UTF-8 string, before any JSON or form parsing. Must be a
str; passing a parsed dict raises TypeError.
bool — True if the signature matches, False otherwise.
If you already have pre-parsed form parameters instead of a raw body, use
validate_request, which accepts either form.