WP Webhooks / Docs / fswa_headers
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 on every delivery attempt after the event-identity and authentication headers are set, and before the custom headers configured in the admin panel are merged in — so a custom header with the same name overrides what this filter returns. For GET and DELETE requests Content-Type is dropped later, as there is no body.

/ Parameters

NameInTypeReqDescription
$headersparamarrayyesHeaders array. Always includes `Content-Type`, `X-Event-Id`, `X-Event-Timestamp`, `X-Webhook-Id`, plus the authentication header when the webhook has a vault credential or auth header.
$webhookparamarrayyesFull webhook configuration row.
$triggerparamstringyesWordPress 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

Your next automation is
one sentence away.

$ wp plugin install flowsystems-webhook-actions --activate