---
title: "fswa_webhook_data — Filter Hook"
description: "Filters webhook data before it is returned in REST API responses."
url: "https://wpwebhooks.org/docs/fswa-webhook-data/"
---

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

Filter since v1.3.0

# fswa\_webhook\_data

Filters webhook data before it is returned in REST API responses.

/ Signature

```
apply_filters( 'fswa_webhook_data', $data, $webhook_id )
```

/ When it fires

Fires when a webhook is fetched via the REST API (single webhook or list endpoint).

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $data | param | array | yes | Serialized webhook data array returned by the REST endpoint. |
| $webhook\_id | param | int | yes | Webhook configuration ID. |

/ Returns

`array` Modified webhook data. Pro uses this to append per-webhook retry/backoff fields.

/ Examples

Append a custom computed field to webhook responses

```
add_filter( 'fswa_webhook_data', function ( $data, $webhook_id ) {
    $data['delivery_count'] = (int) get_option( "my_webhook_{$webhook_id}_count", 0 );
    return $data;
}, 10, 2 );
```

/ Related

[REST API](https://wpwebhooks.org/docs/rest-api/)[fswa\_webhook\_saved](https://wpwebhooks.org/docs/fswa-webhook-saved/)

/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_webhook_data — Filter Hook — Webhook Actions Docs","description":"Filters webhook data before it is returned in REST API responses.","url":"https://wpwebhooks.org/docs/fswa-webhook-data/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
