---
title: "fswa_headers — Filter Hook"
description: "Filters the HTTP headers sent with each webhook request."
url: "https://wpwebhooks.org/docs/fswa-headers/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/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 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

[Custom Request Headers](https://wpwebhooks.org/docs/custom-headers/)[fswa\_http\_args](https://wpwebhooks.org/docs/fswa-http-args/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

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

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"fswa_headers — Filter Hook — Webhook Actions Docs","description":"Filters the HTTP headers sent with each webhook request.","url":"https://wpwebhooks.org/docs/fswa-headers/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
