---
title: "fswa_webhook_url — Filter Hook"
description: "Rewrites the webhook endpoint URL per-event before dispatch."
url: "https://wpwebhooks.org/docs/fswa-webhook-url/"
---

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

Filter since v1.0.0

# fswa\_webhook\_url

Rewrites the webhook endpoint URL per-event before dispatch.

/ Signature

```
apply_filters( 'fswa_webhook_url', $url, $payload, $webhook, $trigger, $original_payload )
```

/ When it fires

Fires after Pro URL template expansion (`{{ field }}` tokens), just before the HTTP request is built.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $url | param | string | yes | The configured endpoint URL (may already contain expanded Pro templates). |
| $payload | param | array | yes | The final outgoing payload (post-mapping, post-Code Glue). |
| $webhook | param | array | yes | Full webhook configuration row. |
| $trigger | param | string | yes | WordPress action name. |
| $original\_payload | param | array|null | — | Pre-mapping payload as fallback for token resolution. |

/ Returns

`string` The URL to use for this delivery. Must be a valid HTTPS URL (unless \`fswa\_require\_https\` is false).

/ Examples

Inject a record ID from payload into the URL path

```
add_filter( 'fswa_webhook_url', function ( $url, $payload, $webhook, $trigger, $original ) {
    if ( (int) $webhook['id'] !== 30 ) return $url;
    $deal_id = $payload['_hs_deal_id'] ?? '';
    return "https://api.hubapi.com/crm/v3/objects/deals/{$deal_id}";
}, 10, 5 );
```

/ Related

[Dynamic URL Templates](https://wpwebhooks.org/docs/dynamic-url-templates/)[Dynamic URLs via Filter](https://wpwebhooks.org/docs/dynamic-urls/)[fswa\_webhook\_payload](https://wpwebhooks.org/docs/fswa-webhook-payload/)

/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_url — Filter Hook — Webhook Actions Docs","description":"Rewrites the webhook endpoint URL per-event before dispatch.","url":"https://wpwebhooks.org/docs/fswa-webhook-url/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
