Filter since v1.0.0
fswa_headers
Filters the HTTP headers sent with each webhook request.
$
/ Signature
apply_filters( 'fswa_headers', $headers, $webhook, $trigger )
/ When it fires
Fires after custom headers configured in the admin panel are merged in, just before the HTTP request args are built.
/ Parameters
| Name | In | Type | Req | Description |
|---|---|---|---|---|
| $headers | param | array | yes | Headers array. Always includes `Content-Type`, `X-Event-Id`, `X-Event-Timestamp`, `X-Webhook-Id`. |
| $webhook | param | array | yes | Full webhook configuration row. |
| $trigger | param | string | yes | WordPress action name. |
/ Returns
array Modified headers array (key → value string pairs)./ Examples
Add an HMAC signature header
add_filter( 'fswa_headers', function ( $headers, $webhook, $trigger ) { $secret = get_option( 'my_webhook_secret' ); $payload = $headers['X-Event-Id'] ?? ''; $headers['X-Signature'] = 'sha256=' . hash_hmac( 'sha256', $payload, $secret ); return $headers; }, 10, 3 );
/ Related
Ready Stop losing webhooks.
Stop losing webhooks.
Start logging them.
$ wp plugin install flowsystems-webhook-actions --activate