---
title: "fswa_payload — Filter Hook"
description: "Filters the base webhook payload after it is built from the WordPress hook arguments, before it is queued."
url: "https://wpwebhooks.org/docs/fswa-payload/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / fswa\_payload

Filter since v1.0.0

# fswa\_payload

Filters the base webhook payload after it is built from the WordPress hook arguments, before it is queued.

/ Signature

```
apply_filters( 'fswa_payload', $payload, $trigger, $args )
```

/ When it fires

Fires once per trigger event, before the payload is queued. Applies to ALL webhooks watching this trigger. For per-webhook transformation use `fswa_webhook_payload` instead.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $payload | param | array | yes | The built payload. Contains \`event\`, \`hook\`, \`args\`, \`timestamp\`, \`site\` keys by default. |
| $trigger | param | string | yes | The WordPress action name. |
| $args | param | array | yes | Raw WordPress hook arguments. |

/ Returns

`array` Modified payload array. Must remain an array.

/ Examples

Enrich every payload with current user data

```
add_filter( 'fswa_payload', function ( $payload, $trigger, $args ) {
    $user = wp_get_current_user();
    if ( $user->ID ) {
        $payload['acting_user'] = [
            'id'    => $user->ID,
            'email' => $user->user_email,
            'roles' => $user->roles,
        ];
    }
    return $payload;
}, 10, 3 );
```

/ Related

[fswa\_webhook\_payload](https://wpwebhooks.org/docs/fswa-webhook-payload/)[Payload Mapping](https://wpwebhooks.org/docs/payload-mapping/)[Event Identity & Deduplication Headers](https://wpwebhooks.org/docs/event-identity/)

/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_payload — Filter Hook — Webhook Actions Docs","description":"Filters the base webhook payload after it is built from the WordPress hook arguments, before it is queued.","url":"https://wpwebhooks.org/docs/fswa-payload/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
